結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 29 ms
10,460 KB
testcase_01 AC 31 ms
10,396 KB
testcase_02 AC 29 ms
10,512 KB
testcase_03 AC 30 ms
10,396 KB
testcase_04 AC 31 ms
10,452 KB
testcase_05 AC 28 ms
10,408 KB
testcase_06 AC 42 ms
11,716 KB
testcase_07 AC 35 ms
11,508 KB
testcase_08 AC 48 ms
12,556 KB
testcase_09 AC 39 ms
11,796 KB
testcase_10 AC 40 ms
11,752 KB
testcase_11 AC 38 ms
11,408 KB
testcase_12 AC 42 ms
12,228 KB
testcase_13 AC 39 ms
11,520 KB
testcase_14 AC 35 ms
11,472 KB
testcase_15 AC 38 ms
11,488 KB
testcase_16 AC 29 ms
10,604 KB
testcase_17 AC 36 ms
11,412 KB
testcase_18 AC 36 ms
11,476 KB
testcase_19 AC 42 ms
11,464 KB
testcase_20 AC 39 ms
11,388 KB
testcase_21 AC 37 ms
11,656 KB
testcase_22 AC 41 ms
11,656 KB
testcase_23 AC 40 ms
11,396 KB
testcase_24 AC 45 ms
12,080 KB
testcase_25 AC 43 ms
12,208 KB
testcase_26 AC 39 ms
11,572 KB
testcase_27 AC 44 ms
12,488 KB
testcase_28 AC 41 ms
11,660 KB
testcase_29 AC 48 ms
12,384 KB
testcase_30 AC 44 ms
11,656 KB
testcase_31 AC 39 ms
11,736 KB
testcase_32 AC 39 ms
11,528 KB
testcase_33 AC 40 ms
11,416 KB
testcase_34 AC 44 ms
11,744 KB
testcase_35 AC 38 ms
11,444 KB
testcase_36 AC 34 ms
11,064 KB
testcase_37 AC 32 ms
10,892 KB
testcase_38 AC 36 ms
11,192 KB
testcase_39 AC 32 ms
11,032 KB
testcase_40 AC 37 ms
11,460 KB
testcase_41 AC 31 ms
11,360 KB
testcase_42 AC 38 ms
11,568 KB
testcase_43 AC 30 ms
11,184 KB
testcase_44 AC 37 ms
11,324 KB
testcase_45 AC 33 ms
11,116 KB
testcase_46 AC 35 ms
10,892 KB
testcase_47 AC 31 ms
10,752 KB
testcase_48 AC 45 ms
11,484 KB
testcase_49 AC 32 ms
11,440 KB
testcase_50 AC 40 ms
11,388 KB
testcase_51 AC 33 ms
11,364 KB
testcase_52 AC 40 ms
11,516 KB
testcase_53 AC 33 ms
11,184 KB
testcase_54 AC 37 ms
11,428 KB
testcase_55 AC 31 ms
11,268 KB
testcase_56 AC 31 ms
10,780 KB
testcase_57 AC 32 ms
10,868 KB
testcase_58 AC 32 ms
10,768 KB
testcase_59 AC 31 ms
10,592 KB
testcase_60 AC 33 ms
10,952 KB
testcase_61 AC 31 ms
10,948 KB
testcase_62 AC 33 ms
10,844 KB
testcase_63 AC 32 ms
10,732 KB
testcase_64 AC 32 ms
10,720 KB
testcase_65 AC 32 ms
10,792 KB
testcase_66 AC 44 ms
12,028 KB
testcase_67 AC 35 ms
11,716 KB
testcase_68 AC 46 ms
11,540 KB
testcase_69 AC 35 ms
11,364 KB
testcase_70 AC 36 ms
11,320 KB
testcase_71 AC 32 ms
11,296 KB
testcase_72 AC 36 ms
11,196 KB
testcase_73 AC 32 ms
10,920 KB
testcase_74 AC 41 ms
11,500 KB
testcase_75 AC 35 ms
11,388 KB
testcase_76 AC 35 ms
11,768 KB
testcase_77 AC 31 ms
11,144 KB
testcase_78 AC 33 ms
11,744 KB
testcase_79 AC 33 ms
11,660 KB
testcase_80 AC 32 ms
11,440 KB
testcase_81 AC 32 ms
10,456 KB
testcase_82 WA -
testcase_83 AC 30 ms
10,520 KB
testcase_84 AC 44 ms
11,764 KB
testcase_85 AC 62 ms
13,268 KB
testcase_86 AC 30 ms
10,416 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
    ans_lst=[(i,(i+1)%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