結果
問題 | No.1149 色塗りゲーム |
ユーザー | shojin_pro |
提出日時 | 2020-08-07 22:00:56 |
言語 | Java21 (openjdk 21) |
結果 |
WA
|
実行時間 | - |
コード長 | 3,539 bytes |
コンパイル時間 | 2,488 ms |
コンパイル使用メモリ | 80,292 KB |
実行使用メモリ | 70,484 KB |
平均クエリ数 | 19.82 |
最終ジャッジ日時 | 2024-07-17 04:41:32 |
合計ジャッジ時間 | 14,992 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 133 ms
67,720 KB |
testcase_01 | WA | - |
testcase_02 | AC | 160 ms
69,940 KB |
testcase_03 | AC | 156 ms
70,004 KB |
testcase_04 | AC | 158 ms
69,812 KB |
testcase_05 | AC | 160 ms
69,968 KB |
testcase_06 | AC | 160 ms
70,216 KB |
testcase_07 | AC | 159 ms
70,060 KB |
testcase_08 | AC | 161 ms
69,580 KB |
testcase_09 | AC | 160 ms
70,180 KB |
testcase_10 | AC | 165 ms
69,724 KB |
testcase_11 | AC | 160 ms
70,192 KB |
testcase_12 | AC | 161 ms
70,468 KB |
testcase_13 | AC | 163 ms
70,136 KB |
testcase_14 | AC | 165 ms
70,216 KB |
testcase_15 | AC | 164 ms
69,876 KB |
testcase_16 | AC | 165 ms
70,044 KB |
testcase_17 | AC | 164 ms
70,204 KB |
testcase_18 | AC | 163 ms
70,044 KB |
testcase_19 | AC | 167 ms
70,176 KB |
testcase_20 | AC | 165 ms
69,532 KB |
testcase_21 | AC | 167 ms
69,900 KB |
testcase_22 | AC | 167 ms
69,760 KB |
testcase_23 | AC | 166 ms
69,676 KB |
testcase_24 | AC | 166 ms
70,144 KB |
testcase_25 | AC | 172 ms
69,992 KB |
testcase_26 | AC | 168 ms
70,120 KB |
testcase_27 | AC | 166 ms
70,092 KB |
testcase_28 | AC | 170 ms
70,208 KB |
testcase_29 | AC | 170 ms
69,632 KB |
testcase_30 | AC | 222 ms
69,980 KB |
testcase_31 | AC | 214 ms
69,924 KB |
testcase_32 | AC | 215 ms
69,476 KB |
testcase_33 | AC | 221 ms
69,872 KB |
testcase_34 | AC | 227 ms
69,840 KB |
testcase_35 | AC | 218 ms
69,820 KB |
testcase_36 | AC | 228 ms
69,572 KB |
testcase_37 | AC | 233 ms
69,724 KB |
testcase_38 | AC | 224 ms
70,332 KB |
testcase_39 | AC | 234 ms
70,484 KB |
testcase_40 | AC | 243 ms
69,792 KB |
testcase_41 | AC | 238 ms
69,712 KB |
testcase_42 | AC | 237 ms
69,752 KB |
testcase_43 | AC | 235 ms
69,944 KB |
testcase_44 | AC | 249 ms
70,008 KB |
testcase_45 | AC | 245 ms
69,920 KB |
testcase_46 | AC | 245 ms
69,940 KB |
testcase_47 | AC | 254 ms
69,288 KB |
testcase_48 | AC | 254 ms
69,800 KB |
testcase_49 | AC | 261 ms
69,748 KB |
ソースコード
import java.util.*; import java.io.*; public class Main { public static void main(String[] args) throws Exception { FastScanner sc = new FastScanner(System.in); PrintWriter pw = new PrintWriter(System.out); int n = sc.nextInt(); if(n <= 2){ pw.println("1 " + n); pw.flush(); int t = sc.nextInt(); return; }else{ int center = (1+n)/2; boolean isEven = n % 2 == 0; String next = ""; if(isEven){ next += 2 + " " + center; }else{ next += 1 + " " + center; } while(true){ pw.println(next); pw.flush(); int t = sc.nextInt(); if(t != 3){ if(t == 2){ int lose = sc.nextInt(); } return; } int cnt = sc.nextInt(); int k = sc.nextInt(); int nextK = k+cnt-1; if(isEven){ nextK = (center*2+1) + ((center*2+1)-nextK*2); nextK /= 2; }else{ nextK = center + (center-nextK); } next = cnt + " " + nextK; } } } static class GeekInteger { public static void save_sort(int[] array) { shuffle(array); Arrays.sort(array); } public static int[] shuffle(int[] array) { int n = array.length; Random random = new Random(); for (int i = 0, j; i < n; i++) { j = i + random.nextInt(n - i); int randomElement = array[j]; array[j] = array[i]; array[i] = randomElement; } return array; } } } class FastScanner { private BufferedReader reader = null; private StringTokenizer tokenizer = null; public FastScanner(InputStream in) { reader = new BufferedReader(new InputStreamReader(in)); tokenizer = null; } public String next() { if (tokenizer == null || !tokenizer.hasMoreTokens()) { try { tokenizer = new StringTokenizer(reader.readLine()); } catch (IOException e) { throw new RuntimeException(e); } } return tokenizer.nextToken(); } public String nextLine() { if (tokenizer == null || !tokenizer.hasMoreTokens()) { try { return reader.readLine(); } catch (IOException e) { throw new RuntimeException(e); } } return tokenizer.nextToken("\n"); } public long nextLong() { return Long.parseLong(next()); } public int nextInt() { return Integer.parseInt(next()); } public double nextDouble() { return Double.parseDouble(next()); } public String[] nextArray(int n) { String[] a = new String[n]; for (int i = 0; i < n; i++) a[i] = next(); return a; } public int[] nextIntArray(int n) { int[] a = new int[n]; for (int i = 0; i < n; i++) a[i] = nextInt(); return a; } public long[] nextLongArray(int n) { long[] a = new long[n]; for (int i = 0; i < n; i++) a[i] = nextLong(); return a; } }