結果

問題 No.466 ジオラマ
ユーザー H3PO4H3PO4
提出日時 2020-11-24 21:16:19
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 706 bytes
コンパイル時間 716 ms
コンパイル使用メモリ 10,760 KB
実行使用メモリ 10,452 KB
最終ジャッジ日時 2023-10-01 01:13:10
合計ジャッジ時間 9,919 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,928 KB
testcase_01 AC 16 ms
8,144 KB
testcase_02 AC 16 ms
7,828 KB
testcase_03 AC 16 ms
7,820 KB
testcase_04 AC 16 ms
7,808 KB
testcase_05 AC 16 ms
8,236 KB
testcase_06 AC 30 ms
9,312 KB
testcase_07 AC 25 ms
9,068 KB
testcase_08 AC 36 ms
9,860 KB
testcase_09 AC 28 ms
9,188 KB
testcase_10 AC 30 ms
9,352 KB
testcase_11 AC 28 ms
9,244 KB
testcase_12 AC 32 ms
9,468 KB
testcase_13 AC 25 ms
9,016 KB
testcase_14 AC 24 ms
8,984 KB
testcase_15 AC 27 ms
9,056 KB
testcase_16 AC 16 ms
8,308 KB
testcase_17 AC 25 ms
8,904 KB
testcase_18 AC 26 ms
9,120 KB
testcase_19 AC 26 ms
9,108 KB
testcase_20 AC 26 ms
9,220 KB
testcase_21 AC 26 ms
9,024 KB
testcase_22 AC 31 ms
9,348 KB
testcase_23 AC 26 ms
9,084 KB
testcase_24 AC 32 ms
9,500 KB
testcase_25 AC 35 ms
9,660 KB
testcase_26 AC 26 ms
9,028 KB
testcase_27 AC 35 ms
9,648 KB
testcase_28 AC 30 ms
9,276 KB
testcase_29 AC 35 ms
9,736 KB
testcase_30 AC 30 ms
9,204 KB
testcase_31 AC 28 ms
9,320 KB
testcase_32 AC 28 ms
9,180 KB
testcase_33 WA -
testcase_34 AC 29 ms
9,240 KB
testcase_35 AC 27 ms
9,252 KB
testcase_36 WA -
testcase_37 AC 18 ms
8,548 KB
testcase_38 WA -
testcase_39 AC 19 ms
8,736 KB
testcase_40 WA -
testcase_41 AC 20 ms
9,008 KB
testcase_42 WA -
testcase_43 AC 19 ms
9,016 KB
testcase_44 WA -
testcase_45 AC 18 ms
8,840 KB
testcase_46 AC 21 ms
8,636 KB
testcase_47 AC 17 ms
8,412 KB
testcase_48 AC 29 ms
9,268 KB
testcase_49 AC 19 ms
9,092 KB
testcase_50 AC 27 ms
9,308 KB
testcase_51 AC 19 ms
9,024 KB
testcase_52 AC 27 ms
9,156 KB
testcase_53 AC 19 ms
9,068 KB
testcase_54 AC 26 ms
9,072 KB
testcase_55 AC 18 ms
8,952 KB
testcase_56 WA -
testcase_57 AC 17 ms
8,324 KB
testcase_58 WA -
testcase_59 AC 16 ms
8,152 KB
testcase_60 WA -
testcase_61 AC 18 ms
8,452 KB
testcase_62 WA -
testcase_63 AC 17 ms
8,336 KB
testcase_64 WA -
testcase_65 AC 16 ms
8,340 KB
testcase_66 AC 30 ms
9,328 KB
testcase_67 AC 19 ms
9,208 KB
testcase_68 AC 26 ms
9,244 KB
testcase_69 AC 19 ms
8,836 KB
testcase_70 AC 24 ms
8,900 KB
testcase_71 AC 18 ms
8,844 KB
testcase_72 AC 21 ms
8,704 KB
testcase_73 AC 17 ms
8,652 KB
testcase_74 AC 28 ms
9,188 KB
testcase_75 AC 19 ms
8,900 KB
testcase_76 AC 19 ms
9,128 KB
testcase_77 AC 18 ms
8,716 KB
testcase_78 AC 19 ms
9,196 KB
testcase_79 AC 20 ms
9,208 KB
testcase_80 AC 19 ms
9,020 KB
testcase_81 AC 16 ms
7,780 KB
testcase_82 WA -
testcase_83 AC 17 ms
7,824 KB
testcase_84 WA -
testcase_85 AC 44 ms
10,452 KB
testcase_86 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

def is_impossible(flag):
    if flag: print(-1);exit()


A, B, C, D = map(int, input().split())

waterway = []
tmp = 2
for _ in range(A - C - 1):
    waterway.append((0, tmp))
    tmp += 1
for _ in range(B - C - 1):
    waterway.append((1, tmp))
    tmp += 1
if C:
    if A == C:
        join = 0
        waterway.append((0, 1))
    elif B == C:
        join = 1
        waterway.append((0, 1))
    else:
        join = tmp
        waterway.append((0, join))
        waterway.append((1, join))
        tmp += 1
    for _ in range(C - 1):
        waterway.append((join, tmp))
        tmp += 1

N = tmp
is_impossible(N < 2)
M = len(waterway)
is_impossible(M > D)
print(N, M)
for w in waterway:
    print(*w)
0