結果

問題 No.466 ジオラマ
ユーザー vwxyzvwxyz
提出日時 2023-07-15 03:21:44
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 1,656 bytes
コンパイル時間 1,380 ms
コンパイル使用メモリ 10,936 KB
実行使用メモリ 13,252 KB
最終ジャッジ日時 2023-10-14 17:52:28
合計ジャッジ時間 11,536 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 31 ms
10,612 KB
testcase_01 AC 30 ms
10,580 KB
testcase_02 AC 29 ms
10,492 KB
testcase_03 AC 29 ms
10,536 KB
testcase_04 AC 31 ms
10,452 KB
testcase_05 AC 29 ms
10,508 KB
testcase_06 AC 43 ms
11,776 KB
testcase_07 AC 36 ms
11,424 KB
testcase_08 AC 49 ms
12,608 KB
testcase_09 AC 40 ms
11,648 KB
testcase_10 AC 45 ms
11,772 KB
testcase_11 AC 40 ms
11,496 KB
testcase_12 AC 43 ms
12,180 KB
testcase_13 AC 38 ms
11,640 KB
testcase_14 AC 36 ms
11,468 KB
testcase_15 AC 41 ms
11,432 KB
testcase_16 AC 32 ms
10,552 KB
testcase_17 AC 38 ms
11,376 KB
testcase_18 AC 39 ms
11,460 KB
testcase_19 AC 38 ms
11,620 KB
testcase_20 AC 39 ms
11,560 KB
testcase_21 AC 38 ms
11,540 KB
testcase_22 AC 44 ms
11,720 KB
testcase_23 AC 38 ms
11,512 KB
testcase_24 AC 45 ms
12,176 KB
testcase_25 AC 47 ms
12,344 KB
testcase_26 AC 38 ms
11,432 KB
testcase_27 AC 50 ms
12,540 KB
testcase_28 AC 41 ms
11,712 KB
testcase_29 AC 45 ms
12,336 KB
testcase_30 AC 44 ms
11,860 KB
testcase_31 AC 43 ms
11,724 KB
testcase_32 AC 39 ms
11,568 KB
testcase_33 AC 40 ms
11,460 KB
testcase_34 AC 43 ms
11,768 KB
testcase_35 AC 42 ms
11,520 KB
testcase_36 AC 33 ms
11,128 KB
testcase_37 AC 30 ms
10,788 KB
testcase_38 AC 34 ms
11,292 KB
testcase_39 AC 29 ms
11,132 KB
testcase_40 AC 39 ms
11,516 KB
testcase_41 AC 34 ms
11,244 KB
testcase_42 AC 39 ms
11,396 KB
testcase_43 AC 32 ms
11,316 KB
testcase_44 AC 40 ms
11,400 KB
testcase_45 AC 33 ms
11,228 KB
testcase_46 AC 33 ms
11,028 KB
testcase_47 AC 29 ms
10,828 KB
testcase_48 AC 41 ms
11,460 KB
testcase_49 AC 34 ms
11,440 KB
testcase_50 AC 40 ms
11,468 KB
testcase_51 AC 32 ms
11,376 KB
testcase_52 AC 40 ms
11,664 KB
testcase_53 AC 32 ms
11,240 KB
testcase_54 AC 41 ms
11,424 KB
testcase_55 AC 39 ms
11,200 KB
testcase_56 WA -
testcase_57 AC 29 ms
10,704 KB
testcase_58 WA -
testcase_59 AC 30 ms
10,636 KB
testcase_60 WA -
testcase_61 AC 33 ms
10,968 KB
testcase_62 WA -
testcase_63 AC 31 ms
10,776 KB
testcase_64 WA -
testcase_65 AC 32 ms
10,772 KB
testcase_66 AC 42 ms
12,084 KB
testcase_67 AC 34 ms
11,768 KB
testcase_68 AC 42 ms
11,504 KB
testcase_69 AC 31 ms
11,364 KB
testcase_70 AC 37 ms
11,400 KB
testcase_71 AC 33 ms
11,232 KB
testcase_72 AC 39 ms
11,180 KB
testcase_73 AC 34 ms
11,036 KB
testcase_74 AC 41 ms
11,520 KB
testcase_75 AC 33 ms
11,452 KB
testcase_76 AC 35 ms
11,772 KB
testcase_77 AC 33 ms
11,204 KB
testcase_78 AC 33 ms
11,832 KB
testcase_79 AC 33 ms
11,772 KB
testcase_80 AC 35 ms
11,496 KB
testcase_81 AC 30 ms
10,452 KB
testcase_82 WA -
testcase_83 AC 31 ms
10,460 KB
testcase_84 WA -
testcase_85 AC 57 ms
13,252 KB
testcase_86 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import bisect
import copy
import decimal
import fractions
import heapq
import itertools
import math
import random
import sys
import time
from collections import Counter,deque,defaultdict
from functools import lru_cache,reduce
from heapq import heappush,heappop,heapify,heappushpop,_heappop_max,_heapify_max
def _heappush_max(heap,item):
    heap.append(item)
    heapq._siftdown_max(heap, 0, len(heap)-1)
def _heappushpop_max(heap, item):
    if heap and item < heap[0]:
        item, heap[0] = heap[0], item
        heapq._siftup_max(heap, 0)
    return item
from math import gcd as GCD
read=sys.stdin.read
readline=sys.stdin.readline
readlines=sys.stdin.readlines
write=sys.stdout.write

A,B,C,D=map(int,readline().split())
if A==C and B==C:
    N=C
    ans_lst=[(i,i%N) for i in range(N)]
elif A==C:
    ans_lst=[]
    ans_lst.append((1,0))
    for i in range(2,A+1):
        ans_lst.append((0,i))
    for i in range(A+1,B):
        ans_lst.append((1,i))
    N=B
elif B==C:
    ans_lst=[]
    ans_lst.append((0,1))
    for i in range(2,B+1):
        ans_lst.append((1,i))
    for i in range(B+1,A):
        ans_lst.append((0,i))
    N=A
else:
    ans_lst=[]
    if C:
        ans_lst.append((0,2))
        ans_lst.append((1,2))
        for i in range(2,C+1):
            ans_lst.append((i,i+1))
    if A-C-1:
        ans_lst.append((0,C+2))
        for i in range(C+2,C+2+(A-C-2)):
            ans_lst.append((i,i+1))
    if B-C-1:
        ans_lst.append((1,A+1))
        for i in range(A+1,A+1+(B-C-2)):
            ans_lst.append((i,i+1))
    N=A+B-C
M=len(ans_lst)
if D<M:
    print(-1)
else:
    print(N,M)
    for a,b in ans_lst:
        print(a,b)
0