結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 31 ms
10,452 KB
testcase_01 AC 30 ms
10,572 KB
testcase_02 AC 31 ms
10,500 KB
testcase_03 WA -
testcase_04 AC 31 ms
10,576 KB
testcase_05 AC 31 ms
10,536 KB
testcase_06 AC 44 ms
11,836 KB
testcase_07 AC 42 ms
11,528 KB
testcase_08 AC 49 ms
12,708 KB
testcase_09 AC 42 ms
11,864 KB
testcase_10 AC 43 ms
11,800 KB
testcase_11 AC 41 ms
11,684 KB
testcase_12 AC 45 ms
12,156 KB
testcase_13 AC 38 ms
11,464 KB
testcase_14 AC 36 ms
11,384 KB
testcase_15 AC 39 ms
11,500 KB
testcase_16 AC 32 ms
10,608 KB
testcase_17 AC 35 ms
11,444 KB
testcase_18 AC 38 ms
11,484 KB
testcase_19 AC 40 ms
11,548 KB
testcase_20 AC 41 ms
11,480 KB
testcase_21 AC 40 ms
11,500 KB
testcase_22 AC 43 ms
11,700 KB
testcase_23 AC 38 ms
11,464 KB
testcase_24 AC 44 ms
12,152 KB
testcase_25 AC 45 ms
12,348 KB
testcase_26 AC 39 ms
11,568 KB
testcase_27 AC 46 ms
12,496 KB
testcase_28 AC 42 ms
11,732 KB
testcase_29 AC 54 ms
12,448 KB
testcase_30 AC 48 ms
11,876 KB
testcase_31 AC 42 ms
11,764 KB
testcase_32 WA -
testcase_33 WA -
testcase_34 AC 42 ms
11,700 KB
testcase_35 AC 40 ms
11,460 KB
testcase_36 WA -
testcase_37 AC 33 ms
10,968 KB
testcase_38 WA -
testcase_39 AC 33 ms
11,052 KB
testcase_40 WA -
testcase_41 AC 32 ms
11,428 KB
testcase_42 WA -
testcase_43 AC 33 ms
11,348 KB
testcase_44 WA -
testcase_45 AC 32 ms
11,160 KB
testcase_46 WA -
testcase_47 AC 32 ms
10,784 KB
testcase_48 WA -
testcase_49 AC 34 ms
11,484 KB
testcase_50 WA -
testcase_51 AC 33 ms
11,356 KB
testcase_52 WA -
testcase_53 AC 33 ms
11,280 KB
testcase_54 WA -
testcase_55 AC 37 ms
11,252 KB
testcase_56 WA -
testcase_57 AC 31 ms
10,684 KB
testcase_58 WA -
testcase_59 AC 30 ms
10,640 KB
testcase_60 WA -
testcase_61 AC 31 ms
10,856 KB
testcase_62 WA -
testcase_63 AC 32 ms
10,904 KB
testcase_64 WA -
testcase_65 AC 31 ms
10,612 KB
testcase_66 AC 42 ms
11,956 KB
testcase_67 AC 34 ms
11,836 KB
testcase_68 AC 41 ms
11,436 KB
testcase_69 AC 37 ms
11,168 KB
testcase_70 AC 36 ms
11,356 KB
testcase_71 AC 32 ms
11,256 KB
testcase_72 AC 37 ms
11,140 KB
testcase_73 AC 34 ms
11,060 KB
testcase_74 AC 47 ms
11,464 KB
testcase_75 AC 33 ms
11,564 KB
testcase_76 AC 34 ms
11,812 KB
testcase_77 AC 33 ms
11,248 KB
testcase_78 AC 33 ms
11,760 KB
testcase_79 AC 34 ms
11,724 KB
testcase_80 AC 32 ms
11,456 KB
testcase_81 AC 30 ms
10,500 KB
testcase_82 WA -
testcase_83 WA -
testcase_84 WA -
testcase_85 AC 58 ms
13,288 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((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
elif B==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
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