結果

問題 No.466 ジオラマ
ユーザー vwxyzvwxyz
提出日時 2023-07-15 03:23:53
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 63 ms / 2,000 ms
コード長 1,720 bytes
コンパイル時間 946 ms
コンパイル使用メモリ 10,848 KB
実行使用メモリ 13,188 KB
最終ジャッジ日時 2023-10-14 17:54:44
合計ジャッジ時間 9,561 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
10,476 KB
testcase_01 AC 36 ms
10,392 KB
testcase_02 AC 34 ms
10,460 KB
testcase_03 AC 34 ms
10,488 KB
testcase_04 AC 36 ms
10,388 KB
testcase_05 AC 35 ms
10,588 KB
testcase_06 AC 50 ms
11,928 KB
testcase_07 AC 44 ms
11,440 KB
testcase_08 AC 55 ms
12,532 KB
testcase_09 AC 46 ms
11,600 KB
testcase_10 AC 47 ms
11,976 KB
testcase_11 AC 44 ms
11,664 KB
testcase_12 AC 49 ms
12,004 KB
testcase_13 AC 42 ms
11,396 KB
testcase_14 AC 40 ms
11,312 KB
testcase_15 AC 44 ms
11,568 KB
testcase_16 AC 35 ms
10,476 KB
testcase_17 AC 45 ms
11,320 KB
testcase_18 AC 46 ms
11,484 KB
testcase_19 AC 46 ms
11,592 KB
testcase_20 AC 47 ms
11,528 KB
testcase_21 AC 45 ms
11,492 KB
testcase_22 AC 51 ms
11,968 KB
testcase_23 AC 45 ms
11,480 KB
testcase_24 AC 53 ms
12,216 KB
testcase_25 AC 53 ms
12,284 KB
testcase_26 AC 44 ms
11,592 KB
testcase_27 AC 53 ms
12,308 KB
testcase_28 AC 47 ms
11,964 KB
testcase_29 AC 52 ms
12,340 KB
testcase_30 AC 48 ms
11,704 KB
testcase_31 AC 47 ms
11,712 KB
testcase_32 AC 44 ms
11,524 KB
testcase_33 AC 43 ms
11,368 KB
testcase_34 AC 48 ms
11,900 KB
testcase_35 AC 46 ms
11,540 KB
testcase_36 AC 39 ms
11,020 KB
testcase_37 AC 34 ms
10,988 KB
testcase_38 AC 42 ms
11,304 KB
testcase_39 AC 35 ms
10,972 KB
testcase_40 AC 44 ms
11,500 KB
testcase_41 AC 38 ms
11,212 KB
testcase_42 AC 45 ms
11,376 KB
testcase_43 AC 37 ms
11,048 KB
testcase_44 AC 43 ms
11,280 KB
testcase_45 AC 36 ms
11,136 KB
testcase_46 AC 38 ms
10,892 KB
testcase_47 AC 37 ms
10,680 KB
testcase_48 AC 49 ms
11,600 KB
testcase_49 AC 36 ms
11,256 KB
testcase_50 AC 47 ms
11,532 KB
testcase_51 AC 38 ms
11,328 KB
testcase_52 AC 46 ms
11,544 KB
testcase_53 AC 38 ms
11,184 KB
testcase_54 AC 46 ms
11,372 KB
testcase_55 AC 38 ms
11,168 KB
testcase_56 AC 38 ms
10,860 KB
testcase_57 AC 36 ms
10,684 KB
testcase_58 AC 33 ms
10,620 KB
testcase_59 AC 33 ms
10,612 KB
testcase_60 AC 38 ms
11,004 KB
testcase_61 AC 34 ms
10,784 KB
testcase_62 AC 35 ms
10,864 KB
testcase_63 AC 33 ms
10,668 KB
testcase_64 AC 34 ms
10,716 KB
testcase_65 AC 32 ms
10,592 KB
testcase_66 AC 50 ms
11,944 KB
testcase_67 AC 38 ms
11,684 KB
testcase_68 AC 45 ms
11,464 KB
testcase_69 AC 37 ms
11,180 KB
testcase_70 AC 41 ms
11,376 KB
testcase_71 AC 37 ms
11,156 KB
testcase_72 AC 43 ms
11,204 KB
testcase_73 AC 34 ms
10,988 KB
testcase_74 AC 48 ms
11,676 KB
testcase_75 AC 36 ms
11,432 KB
testcase_76 AC 39 ms
11,756 KB
testcase_77 AC 36 ms
11,132 KB
testcase_78 AC 39 ms
11,696 KB
testcase_79 AC 38 ms
11,648 KB
testcase_80 AC 39 ms
11,440 KB
testcase_81 AC 35 ms
10,544 KB
testcase_82 AC 36 ms
10,552 KB
testcase_83 AC 37 ms
10,460 KB
testcase_84 AC 49 ms
11,936 KB
testcase_85 AC 63 ms
13,188 KB
testcase_86 AC 37 ms
10,400 KB
権限があれば一括ダウンロードができます

ソースコード

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
    if N>=2:
        ans_lst=[(i,(i+1)%N) for i in range(N)]
    else:
        print(-1)
        exit()
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