結果

提出番号 2075
提出者 uwi_
言語 Java
提出日時 2018-08-04 15:11:24
問題名 (65)Small Grid and Score
結果 WA
点数 0%

テストケース

テストケース 結果 得点 実行時間 メモリ使用量
1 WA 0% 58ms 93888KB
2 WA 0% 64ms 93104KB
3 WA 0% 67ms 93504KB
4 WA 0% 53ms 93616KB
5 WA 0% 55ms 93584KB
6 WA 0% 72ms 93216KB
7 WA 0% 60ms 93264KB
8 WA 0% 65ms 92288KB
9 WA 0% 61ms 92384KB
10 WA 0% 65ms 92464KB
11 WA 0% 64ms 93040KB
12 WA 0% 54ms 92288KB
13 AC 92% 61ms 92032KB
14 WA 0% 60ms 92976KB
15 AC 92% 52ms 93216KB
16 AC 92% 59ms 92032KB
17 WA 0% 65ms 91760KB
18 AC 92% 63ms 93536KB
19 WA 0% 61ms 93008KB
20 AC 92% 66ms 92432KB
21 WA 0% 55ms 92352KB
22 WA 0% 67ms 93296KB
23 AC 92% 59ms 92048KB
24 WA 0% 65ms 92576KB
テストケース 結果 得点 実行時間 メモリ使用量
25 WA 0% 60ms 93456KB
26 WA 0% 58ms 93776KB
27 WA 0% 52ms 92096KB
28 WA 0% 66ms 92048KB
29 WA 0% 50ms 93200KB
30 WA 0% 64ms 92320KB
31 WA 0% 59ms 93424KB
32 WA 0% 65ms 93232KB
33 WA 0% 60ms 93600KB
34 WA 0% 54ms 93408KB
35 WA 0% 64ms 93024KB
36 WA 0% 52ms 93312KB
37 WA 0% 60ms 93344KB
38 WA 0% 59ms 93696KB
39 WA 0% 58ms 93392KB
40 WA 0% 59ms 92400KB
41 WA 0% 61ms 92816KB
42 WA 0% 54ms 93248KB
43 WA 0% 65ms 93552KB
44 WA 0% 64ms 93328KB
45 WA 0% 64ms 92320KB
46 WA 0% 51ms 94064KB
47 WA 0% 60ms 93408KB
48 WA 0% 66ms 93008KB
49 WA 0% 64ms 92464KB
50 WA 0% 65ms 93248KB
51 WA 0% 64ms 91744KB
52 WA 0% 64ms 93376KB
53 WA 0% 60ms 93648KB
54 WA 0% 59ms 93728KB
55 WA 0% 58ms 93936KB
56 WA 0% 53ms 92944KB
57 WA 0% 60ms 92848KB
58 WA 0% 64ms 92320KB
59 WA 0% 59ms 93024KB
60 WA 0% 50ms 93616KB
61 WA 0% 61ms 93536KB
62 WA 0% 65ms 92576KB
63 WA 0% 54ms 93392KB
64 WA 0% 67ms 93344KB
65 WA 0% 65ms 92576KB
66 WA 0% 66ms 93568KB
67 WA 0% 60ms 93344KB
68 WA 0% 52ms 93376KB
69 WA 0% 53ms 93008KB
70 WA 0% 60ms 91840KB
71 WA 0% 58ms 93712KB
72 WA 0% 64ms 92560KB
73 WA 0% 68ms 93536KB
74 WA 0% 59ms 93840KB
75 WA 0% 60ms 93616KB
76 WA 0% 61ms 93184KB
77 WA 0% 63ms 93856KB
78 WA 0% 54ms 92384KB
79 WA 0% 65ms 92944KB
80 WA 0% 65ms 93008KB
81 WA 0% 51ms 92944KB
82 WA 0% 64ms 93632KB
83 WA 0% 59ms 92608KB
84 WA 0% 64ms 93584KB
85 WA 0% 53ms 92112KB
86 WA 0% 60ms 93632KB
87 WA 0% 59ms 93072KB
88 WA 0% 60ms 93360KB
89 WA 0% 65ms 93584KB
90 WA 0% 64ms 92048KB
91 WA 0% 60ms 92112KB
92 WA 0% 65ms 92624KB
93 WA 0% 60ms 93568KB
94 WA 0% 54ms 93392KB
95 WA 0% 66ms 93536KB
96 WA 0% 65ms 91744KB
97 WA 0% 53ms 93648KB
98 WA 0% 66ms 93664KB
99 WA 0% 60ms 93712KB
100 WA 0% 64ms 92320KB
101 WA 0% 59ms 92032KB
102 WA 0% 65ms 92480KB
103 WA 0% 59ms 93392KB
104 WA 0% 59ms 93600KB
105 WA 0% 60ms 93904KB
106 WA 0% 60ms 92640KB
107 WA 0% 65ms 93360KB
108 WA 0% 51ms 92416KB
109 WA 0% 74ms 93072KB
110 WA 0% 59ms 92160KB
111 WA 0% 65ms 93344KB
112 WA 0% 65ms 92336KB
113 WA 0% 54ms 93040KB
114 WA 0% 59ms 93648KB
115 WA 0% 60ms 93136KB
116 WA 0% 59ms 92448KB
117 WA 0% 51ms 93424KB
118 WA 0% 60ms 92768KB
119 WA 0% 68ms 92496KB
120 WA 0% 64ms 92624KB
121 WA 0% 63ms 93552KB
122 WA 0% 54ms 92112KB
123 WA 0% 62ms 92608KB
124 WA 0% 59ms 93584KB

ソースコード

import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.InputMismatchException;

public class Main {
	static InputStream is;
	static PrintWriter out;
	static String INPUT = "";

	static void solve() {
		long n = nl();
		if(n == 0){
			out.println(2 + " " + 2);
			out.println(".#");
			out.println("#.");
			return;
		}
		int[] u = new int[120];
		int p = 0;
		for(int d = 61;d >= 0;d--){
			if(n<<~d<0){
				for(int e = d-1;e >= 0;e--){
					u[p++] = 2;
					if(n<<~e<0){
						u[p++] = 1;
					}
				}
				int m = p/2+1;
				out.println(m + " " + m);
				char[][] ret = new char[p/2+1][p/2+1];
				for(int i = 0;i < p/2+1;i++){
					Arrays.fill(ret[i], '#');
				}
				for(int i = 0;i < p;i++){
					if(i < m){
						ret[0][i] = (char)('0' + u[i]);
					}else{
						ret[i-m+1][m-1] = (char)('0' + u[i]);
					}
				}
				if(ret[m-1][m-1] == '#')ret[m-1][m-1] = '.';
				for(char[] row : ret){
					out.println(new String(row));
				}
				return;
			}
		}
	}
	
	public static boolean inc(int[] a, int base) {
		int n = a.length;
		int i;
		for (i = n - 1; i >= 0 && a[i] == base - 1; i--)
			;
		if (i == -1)
			return false;

		a[i]++;
		Arrays.fill(a, i + 1, n, 0);
		return true;
	}


	public static void main(String[] args) throws Exception {
		long S = System.currentTimeMillis();
		is = INPUT.isEmpty() ? System.in : new ByteArrayInputStream(INPUT.getBytes());
		out = new PrintWriter(System.out);

		solve();
		out.flush();
		long G = System.currentTimeMillis();
		tr(G - S + "ms");
	}

	private static boolean eof() {
		if (lenbuf == -1)
			return true;
		int lptr = ptrbuf;
		while (lptr < lenbuf)
			if (!isSpaceChar(inbuf[lptr++]))
				return false;

		try {
			is.mark(1000);
			while (true) {
				int b = is.read();
				if (b == -1) {
					is.reset();
					return true;
				} else if (!isSpaceChar(b)) {
					is.reset();
					return false;
				}
			}
		} catch (IOException e) {
			return true;
		}
	}

	private static byte[] inbuf = new byte[1024];
	public static int lenbuf = 0, ptrbuf = 0;

	private static int readByte() {
		if (lenbuf == -1)
			throw new InputMismatchException();
		if (ptrbuf >= lenbuf) {
			ptrbuf = 0;
			try {
				lenbuf = is.read(inbuf);
			} catch (IOException e) {
				throw new InputMismatchException();
			}
			if (lenbuf <= 0)
				return -1;
		}
		return inbuf[ptrbuf++];
	}

	private static boolean isSpaceChar(int c) {
		return !(c >= 33 && c <= 126);
	}

	private static int skip() {
		int b;
		while ((b = readByte()) != -1 && isSpaceChar(b))
			;
		return b;
	}

	private static double nd() {
		return Double.parseDouble(ns());
	}

	private static char nc() {
		return (char) skip();
	}

	private static String ns() {
		int b = skip();
		StringBuilder sb = new StringBuilder();
		while (!(isSpaceChar(b))) { // when nextLine, (isSpaceChar(b) && b != '
									// ')
			sb.appendCodePoint(b);
			b = readByte();
		}
		return sb.toString();
	}

	private static char[] ns(int n) {
		char[] buf = new char[n];
		int b = skip(), p = 0;
		while (p < n && !(isSpaceChar(b))) {
			buf[p++] = (char) b;
			b = readByte();
		}
		return n == p ? buf : Arrays.copyOf(buf, p);
	}

	private static char[][] nm(int n, int m) {
		char[][] map = new char[n][];
		for (int i = 0; i < n; i++)
			map[i] = ns(m);
		return map;
	}

	private static int[] na(int n) {
		int[] a = new int[n];
		for (int i = 0; i < n; i++)
			a[i] = ni();
		return a;
	}

	private static int ni() {
		int num = 0, b;
		boolean minus = false;
		while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'))
			;
		if (b == '-') {
			minus = true;
			b = readByte();
		}

		while (true) {
			if (b >= '0' && b <= '9') {
				num = num * 10 + (b - '0');
			} else {
				return minus ? -num : num;
			}
			b = readByte();
		}
	}

	private static long nl() {
		long num = 0;
		int b;
		boolean minus = false;
		while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'))
			;
		if (b == '-') {
			minus = true;
			b = readByte();
		}

		while (true) {
			if (b >= '0' && b <= '9') {
				num = num * 10 + (b - '0');
			} else {
				return minus ? -num : num;
			}
			b = readByte();
		}
	}

	private static void tr(Object... o) {
		if (INPUT.length() != 0)
			System.out.println(Arrays.deepToString(o));
	}
}