Submission #386703


Source Code Expand

import java.awt.geom.Point2D;
import java.io.*;
import java.math.BigInteger;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.Deque;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.NoSuchElementException;
import java.util.PriorityQueue;
import java.util.Scanner;
import java.util.Stack;
import java.util.TreeMap;



public class Main {

	static PrintWriter out = new PrintWriter(System.out);
	static FastScanner sc = new FastScanner();
	static Scanner stdIn = new Scanner(System.in);

	public static void main (String[] args) {
		char[][] list = new char[4][4];
		char[][] ans = new char[4][4];
		for(int i = 0; i < 4; i++) {
			for(int j = 0; j < 4; j++) {
				list[i][j] = sc.next().charAt(0);
			}
		}
		
		for(int i = 0; i < 4; i++) {
			for(int j = 0; j < 4; j++) {
				ans[i][j] = list[3-i][3-j];
			}
		}
		
		for(int i = 0; i < 4; i++) {
			out.print(ans[i][0]);
			for(int j = 1; j < 4; j++) {
				out.print(" " + ans[i][j]);
			}
			out.println();
		}
		out.flush();
	}
	
}


//------------------------------//
//-----------//
class FastScanner {
    private final InputStream in = System.in;
    private final byte[] buffer = new byte[1024];
    private int ptr = 0;
    private int buflen = 0;
    private boolean hasNextByte() {
        if (ptr < buflen) {
            return true;
        }else{
            ptr = 0;
            try {
                buflen = in.read(buffer);
            } catch (IOException e) {
                e.printStackTrace();
            }
            if (buflen <= 0) {
                return false;
            }
        }
        return true;
    }
    private int readByte() { if (hasNextByte()) return buffer[ptr++]; else return -1;}
    private static boolean isPrintableChar(int c) { return 33 <= c && c <= 126;}
    private void skipUnprintable() { while(hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++;}
    public boolean hasNext() { skipUnprintable(); return hasNextByte();}
    public String next() {
        if (!hasNext()) throw new NoSuchElementException();
        StringBuilder sb = new StringBuilder();
        int b = readByte();
        while(isPrintableChar(b)) {
            sb.appendCodePoint(b);
            b = readByte();
        }
        return sb.toString();
    }
    public long nextLong() {
        if (!hasNext()) throw new NoSuchElementException();
        long n = 0;
        boolean minus = false;
        int b = readByte();
        if (b == '-') {
            minus = true;
            b = readByte();
        }
        if (b < '0' || '9' < b) {
            throw new NumberFormatException();
        }
        while(true){
            if ('0' <= b && b <= '9') {
                n *= 10;
                n += b - '0';
            }else if(b == -1 || !isPrintableChar(b)){
                return minus ? -n : n;
            }else{
                throw new NumberFormatException();
            }
            b = readByte();
        }
    }
    
    public int nextInt() {
    	 if (!hasNext()) throw new NoSuchElementException();
         int n = 0;
         boolean minus = false;
         int b = readByte();
         if (b == '-') {
             minus = true;
             b = readByte();
         }
         if (b < '0' || '9' < b) {
             throw new NumberFormatException();
         }
         while(true){
             if ('0' <= b && b <= '9') {
                 n *= 10;
                 n += b - '0';
             }else if(b == -1 || !isPrintableChar(b)){
                 return minus ? -n : n;
             }else{
                 throw new NumberFormatException();
             }
             b = readByte();
         }
    }
    
    public double nextDouble() {
    	return Double.parseDouble(next());
    }
    

}

Submission Info

Submission Time
Task B - 回転
User XzA_2123
Language Java (OpenJDK 1.7.0)
Score 100
Code Size 4023 Byte
Status AC
Exec Time 383 ms
Memory 17176 KB

Judge Result

Set Name All
Score / Max Score 100 / 100
Status
AC × 30
Set Name Test Cases
All 00_sample_00.txt, 00_sample_01.txt, 01_all_dot.txt, 02_all_o.txt, 03_all_x.txt, rand_0.txt, rand_1.txt, rand_10.txt, rand_11.txt, rand_12.txt, rand_13.txt, rand_14.txt, rand_15.txt, rand_16.txt, rand_17.txt, rand_18.txt, rand_19.txt, rand_2.txt, rand_20.txt, rand_21.txt, rand_22.txt, rand_23.txt, rand_24.txt, rand_3.txt, rand_4.txt, rand_5.txt, rand_6.txt, rand_7.txt, rand_8.txt, rand_9.txt
Case Name Status Exec Time Memory
00_sample_00.txt AC 356 ms 17076 KB
00_sample_01.txt AC 372 ms 17012 KB
01_all_dot.txt AC 364 ms 17060 KB
02_all_o.txt AC 366 ms 17004 KB
03_all_x.txt AC 377 ms 17036 KB
rand_0.txt AC 362 ms 17144 KB
rand_1.txt AC 356 ms 17060 KB
rand_10.txt AC 360 ms 17060 KB
rand_11.txt AC 369 ms 17096 KB
rand_12.txt AC 367 ms 17072 KB
rand_13.txt AC 368 ms 17092 KB
rand_14.txt AC 359 ms 17064 KB
rand_15.txt AC 357 ms 17088 KB
rand_16.txt AC 347 ms 17084 KB
rand_17.txt AC 357 ms 16992 KB
rand_18.txt AC 358 ms 17176 KB
rand_19.txt AC 364 ms 17064 KB
rand_2.txt AC 359 ms 17068 KB
rand_20.txt AC 357 ms 17048 KB
rand_21.txt AC 363 ms 17024 KB
rand_22.txt AC 354 ms 17084 KB
rand_23.txt AC 357 ms 17052 KB
rand_24.txt AC 360 ms 16940 KB
rand_3.txt AC 343 ms 17016 KB
rand_4.txt AC 355 ms 17032 KB
rand_5.txt AC 368 ms 16980 KB
rand_6.txt AC 360 ms 17088 KB
rand_7.txt AC 354 ms 17068 KB
rand_8.txt AC 383 ms 16996 KB
rand_9.txt AC 360 ms 17048 KB