結果
問題 | No.466 ジオラマ |
ユーザー | Grenache |
提出日時 | 2016-12-16 20:55:50 |
言語 | Java21 (openjdk 21) |
結果 |
AC
|
実行時間 | 316 ms / 2,000 ms |
コード長 | 2,416 bytes |
コンパイル時間 | 3,833 ms |
コンパイル使用メモリ | 78,864 KB |
実行使用メモリ | 47,688 KB |
最終ジャッジ日時 | 2024-11-30 10:40:46 |
合計ジャッジ時間 | 25,258 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 160 ms
41,552 KB |
testcase_01 | AC | 137 ms
41,612 KB |
testcase_02 | AC | 137 ms
41,176 KB |
testcase_03 | AC | 135 ms
41,520 KB |
testcase_04 | AC | 138 ms
41,412 KB |
testcase_05 | AC | 135 ms
41,444 KB |
testcase_06 | AC | 269 ms
46,704 KB |
testcase_07 | AC | 253 ms
46,524 KB |
testcase_08 | AC | 297 ms
47,252 KB |
testcase_09 | AC | 266 ms
46,472 KB |
testcase_10 | AC | 265 ms
46,512 KB |
testcase_11 | AC | 258 ms
46,416 KB |
testcase_12 | AC | 274 ms
46,580 KB |
testcase_13 | AC | 251 ms
46,300 KB |
testcase_14 | AC | 247 ms
46,028 KB |
testcase_15 | AC | 254 ms
46,376 KB |
testcase_16 | AC | 155 ms
40,568 KB |
testcase_17 | AC | 245 ms
46,392 KB |
testcase_18 | AC | 250 ms
46,404 KB |
testcase_19 | AC | 250 ms
46,312 KB |
testcase_20 | AC | 260 ms
46,300 KB |
testcase_21 | AC | 252 ms
46,636 KB |
testcase_22 | AC | 255 ms
46,332 KB |
testcase_23 | AC | 255 ms
46,460 KB |
testcase_24 | AC | 282 ms
47,652 KB |
testcase_25 | AC | 279 ms
46,900 KB |
testcase_26 | AC | 251 ms
46,392 KB |
testcase_27 | AC | 290 ms
47,448 KB |
testcase_28 | AC | 264 ms
46,240 KB |
testcase_29 | AC | 286 ms
47,688 KB |
testcase_30 | AC | 267 ms
46,456 KB |
testcase_31 | AC | 256 ms
46,384 KB |
testcase_32 | AC | 261 ms
46,568 KB |
testcase_33 | AC | 249 ms
46,792 KB |
testcase_34 | AC | 262 ms
46,248 KB |
testcase_35 | AC | 247 ms
46,600 KB |
testcase_36 | AC | 240 ms
45,724 KB |
testcase_37 | AC | 135 ms
41,380 KB |
testcase_38 | AC | 246 ms
47,168 KB |
testcase_39 | AC | 132 ms
41,420 KB |
testcase_40 | AC | 258 ms
46,424 KB |
testcase_41 | AC | 134 ms
41,324 KB |
testcase_42 | AC | 257 ms
46,520 KB |
testcase_43 | AC | 132 ms
41,196 KB |
testcase_44 | AC | 251 ms
46,916 KB |
testcase_45 | AC | 135 ms
41,500 KB |
testcase_46 | AC | 230 ms
44,580 KB |
testcase_47 | AC | 131 ms
41,444 KB |
testcase_48 | AC | 268 ms
46,616 KB |
testcase_49 | AC | 131 ms
41,160 KB |
testcase_50 | AC | 267 ms
46,772 KB |
testcase_51 | AC | 135 ms
41,168 KB |
testcase_52 | AC | 257 ms
46,892 KB |
testcase_53 | AC | 134 ms
41,468 KB |
testcase_54 | AC | 253 ms
46,104 KB |
testcase_55 | AC | 135 ms
41,472 KB |
testcase_56 | AC | 218 ms
43,876 KB |
testcase_57 | AC | 118 ms
40,436 KB |
testcase_58 | AC | 167 ms
42,040 KB |
testcase_59 | AC | 132 ms
41,352 KB |
testcase_60 | AC | 231 ms
44,648 KB |
testcase_61 | AC | 134 ms
41,576 KB |
testcase_62 | AC | 224 ms
43,756 KB |
testcase_63 | AC | 134 ms
41,516 KB |
testcase_64 | AC | 214 ms
43,468 KB |
testcase_65 | AC | 134 ms
41,384 KB |
testcase_66 | AC | 270 ms
46,304 KB |
testcase_67 | AC | 131 ms
41,272 KB |
testcase_68 | AC | 251 ms
46,456 KB |
testcase_69 | AC | 132 ms
41,364 KB |
testcase_70 | AC | 245 ms
46,016 KB |
testcase_71 | AC | 134 ms
41,472 KB |
testcase_72 | AC | 232 ms
44,916 KB |
testcase_73 | AC | 138 ms
41,300 KB |
testcase_74 | AC | 245 ms
46,540 KB |
testcase_75 | AC | 131 ms
41,472 KB |
testcase_76 | AC | 135 ms
41,256 KB |
testcase_77 | AC | 132 ms
41,164 KB |
testcase_78 | AC | 119 ms
40,548 KB |
testcase_79 | AC | 120 ms
40,052 KB |
testcase_80 | AC | 134 ms
41,196 KB |
testcase_81 | AC | 134 ms
41,420 KB |
testcase_82 | AC | 134 ms
41,312 KB |
testcase_83 | AC | 126 ms
40,060 KB |
testcase_84 | AC | 276 ms
46,648 KB |
testcase_85 | AC | 316 ms
46,684 KB |
testcase_86 | AC | 138 ms
41,524 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) { if (a == 1) { pr.println(-1); return; } 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); } } }