結果
問題 | No.466 ジオラマ |
ユーザー | Grenache |
提出日時 | 2016-12-16 20:50:12 |
言語 | Java21 (openjdk 21) |
結果 |
WA
|
実行時間 | - |
コード長 | 2,362 bytes |
コンパイル時間 | 4,468 ms |
コンパイル使用メモリ | 82,440 KB |
実行使用メモリ | 54,232 KB |
最終ジャッジ日時 | 2024-11-30 10:41:56 |
合計ジャッジ時間 | 25,786 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 159 ms
41,456 KB |
testcase_01 | AC | 133 ms
41,468 KB |
testcase_02 | AC | 140 ms
41,972 KB |
testcase_03 | AC | 137 ms
41,544 KB |
testcase_04 | AC | 134 ms
41,736 KB |
testcase_05 | AC | 122 ms
40,476 KB |
testcase_06 | AC | 270 ms
46,544 KB |
testcase_07 | AC | 250 ms
46,696 KB |
testcase_08 | AC | 292 ms
47,288 KB |
testcase_09 | AC | 257 ms
46,320 KB |
testcase_10 | AC | 270 ms
46,400 KB |
testcase_11 | AC | 250 ms
46,420 KB |
testcase_12 | AC | 286 ms
47,724 KB |
testcase_13 | AC | 250 ms
46,448 KB |
testcase_14 | AC | 244 ms
46,540 KB |
testcase_15 | AC | 253 ms
46,452 KB |
testcase_16 | AC | 168 ms
42,068 KB |
testcase_17 | AC | 247 ms
46,472 KB |
testcase_18 | AC | 251 ms
46,804 KB |
testcase_19 | AC | 256 ms
46,576 KB |
testcase_20 | AC | 257 ms
46,408 KB |
testcase_21 | AC | 249 ms
46,436 KB |
testcase_22 | AC | 269 ms
46,560 KB |
testcase_23 | AC | 255 ms
46,964 KB |
testcase_24 | AC | 275 ms
47,352 KB |
testcase_25 | AC | 291 ms
47,020 KB |
testcase_26 | AC | 239 ms
46,540 KB |
testcase_27 | AC | 283 ms
46,884 KB |
testcase_28 | AC | 267 ms
47,040 KB |
testcase_29 | AC | 284 ms
46,968 KB |
testcase_30 | AC | 248 ms
46,584 KB |
testcase_31 | AC | 259 ms
46,648 KB |
testcase_32 | AC | 266 ms
47,372 KB |
testcase_33 | AC | 254 ms
46,420 KB |
testcase_34 | AC | 261 ms
46,616 KB |
testcase_35 | AC | 257 ms
46,940 KB |
testcase_36 | AC | 226 ms
45,276 KB |
testcase_37 | AC | 134 ms
41,652 KB |
testcase_38 | AC | 246 ms
46,640 KB |
testcase_39 | AC | 134 ms
41,320 KB |
testcase_40 | AC | 261 ms
46,408 KB |
testcase_41 | AC | 134 ms
41,456 KB |
testcase_42 | AC | 258 ms
47,284 KB |
testcase_43 | AC | 134 ms
41,452 KB |
testcase_44 | AC | 255 ms
47,044 KB |
testcase_45 | AC | 133 ms
41,632 KB |
testcase_46 | AC | 229 ms
44,708 KB |
testcase_47 | AC | 134 ms
41,324 KB |
testcase_48 | AC | 268 ms
46,920 KB |
testcase_49 | AC | 135 ms
41,536 KB |
testcase_50 | AC | 267 ms
46,328 KB |
testcase_51 | AC | 135 ms
41,800 KB |
testcase_52 | AC | 254 ms
46,712 KB |
testcase_53 | AC | 131 ms
41,164 KB |
testcase_54 | AC | 256 ms
46,508 KB |
testcase_55 | AC | 133 ms
41,292 KB |
testcase_56 | AC | 217 ms
43,660 KB |
testcase_57 | AC | 122 ms
40,292 KB |
testcase_58 | AC | 176 ms
42,096 KB |
testcase_59 | AC | 137 ms
41,328 KB |
testcase_60 | AC | 231 ms
44,616 KB |
testcase_61 | AC | 134 ms
41,336 KB |
testcase_62 | AC | 228 ms
44,336 KB |
testcase_63 | AC | 118 ms
40,332 KB |
testcase_64 | AC | 202 ms
43,656 KB |
testcase_65 | AC | 132 ms
41,256 KB |
testcase_66 | AC | 279 ms
47,368 KB |
testcase_67 | AC | 137 ms
41,608 KB |
testcase_68 | AC | 248 ms
46,512 KB |
testcase_69 | AC | 135 ms
41,460 KB |
testcase_70 | AC | 235 ms
46,436 KB |
testcase_71 | AC | 135 ms
41,224 KB |
testcase_72 | AC | 238 ms
45,300 KB |
testcase_73 | AC | 134 ms
41,460 KB |
testcase_74 | AC | 252 ms
46,688 KB |
testcase_75 | AC | 137 ms
41,456 KB |
testcase_76 | AC | 138 ms
41,608 KB |
testcase_77 | AC | 138 ms
41,480 KB |
testcase_78 | AC | 138 ms
41,428 KB |
testcase_79 | AC | 136 ms
41,588 KB |
testcase_80 | AC | 132 ms
41,452 KB |
testcase_81 | AC | 135 ms
41,704 KB |
testcase_82 | WA | - |
testcase_83 | AC | 139 ms
41,688 KB |
testcase_84 | AC | 266 ms
46,456 KB |
testcase_85 | AC | 315 ms
47,144 KB |
testcase_86 | AC | 135 ms
41,464 KB |
ソースコード
import java.io.*; import java.util.*; public class Main_yukicoder466 { private static Scanner sc; private static Printer pr; private static void solve() { int a = sc.nextInt(); int b = sc.nextInt(); int c = sc.nextInt(); int d = sc.nextInt(); if (c == 0) { int min = a - 1 + b - 1; if (d < min) { pr.println(-1); return; } int n = a + b; pr.printf("%d %d\n", n, min); for (int v = 2; v < 2 + a - 1; v++) { pr.printf("%d %d\n", 0, v); } for (int v = a + 1; v < n; v++) { pr.printf("%d %d\n", 1, v); } } else if (a == c && c == b) { int min = a - 1 + 1; if (d < min) { pr.println(-1); return; } int n = a; pr.printf("%d %d\n", n, min); pr.printf("%d %d\n", 0, 1); pr.printf("%d %d\n", 1, 0); for (int v = 2; v < 2 + a - 2; v++) { pr.printf("%d %d\n", 0, v); } } else if (a == c && c != b) { int min = a - 1 + 1 + b - c - 1; if (d < min) { pr.println(-1); return; } int n = b; pr.printf("%d %d\n", n, min); pr.printf("%d %d\n", 1, 0); for (int v = 2; v < 2 + a - 1; v++) { pr.printf("%d %d\n", 0, v); } for (int v = a + 1; v < n; v++) { pr.printf("%d %d\n", 1, v); } } else if (a != c && c == b) { int min = b - 1 + 1 + a - c - 1; if (d < min) { pr.println(-1); return; } int n = a; pr.printf("%d %d\n", n, min); pr.printf("%d %d\n", 0, 1); for (int v = 2; v < 2 + b - 1; v++) { pr.printf("%d %d\n", 1, v); } for (int v = b + 1; v < n; v++) { pr.printf("%d %d\n", 0, v); } } else { int min = a + b - c - 1; if (d < min) { pr.println(-1); return; } int n = a + b - c; pr.printf("%d %d\n", n, min); for (int v = 2; v < 2 + a - c - 1; v++) { pr.printf("%d %d\n", 0, v); } for (int v = a - c + 1; v < n - c; v++) { pr.printf("%d %d\n", 1, v); } pr.printf("%d %d\n", 0, n - c); pr.printf("%d %d\n", 1, n - c); for (int v = n - c + 1; v < n; v++) { pr.printf("%d %d\n", n - c, v); } } } // --------------------------------------------------- public static void main(String[] args) { sc = new Scanner(System.in); pr = new Printer(System.out); solve(); pr.close(); sc.close(); } private static class Printer extends PrintWriter { Printer(PrintStream out) { super(out); } } }