結果

問題 No.466 ジオラマ
ユーザー mkawa2mkawa2
提出日時 2020-04-30 16:07:52
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 2,166 bytes
コンパイル時間 370 ms
コンパイル使用メモリ 11,212 KB
実行使用メモリ 9,132 KB
最終ジャッジ日時 2023-08-22 06:02:10
合計ジャッジ時間 7,768 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 20 ms
8,816 KB
testcase_01 AC 21 ms
8,840 KB
testcase_02 AC 21 ms
8,932 KB
testcase_03 AC 21 ms
8,788 KB
testcase_04 AC 21 ms
8,832 KB
testcase_05 AC 20 ms
8,724 KB
testcase_06 AC 29 ms
9,000 KB
testcase_07 AC 26 ms
8,900 KB
testcase_08 AC 33 ms
9,028 KB
testcase_09 AC 29 ms
8,976 KB
testcase_10 AC 29 ms
8,988 KB
testcase_11 AC 27 ms
8,972 KB
testcase_12 AC 31 ms
9,128 KB
testcase_13 AC 26 ms
8,900 KB
testcase_14 AC 25 ms
8,988 KB
testcase_15 AC 27 ms
9,080 KB
testcase_16 AC 21 ms
8,748 KB
testcase_17 AC 26 ms
9,088 KB
testcase_18 AC 27 ms
8,936 KB
testcase_19 AC 27 ms
9,092 KB
testcase_20 AC 27 ms
9,008 KB
testcase_21 AC 27 ms
9,084 KB
testcase_22 AC 30 ms
8,960 KB
testcase_23 AC 27 ms
9,132 KB
testcase_24 AC 31 ms
9,056 KB
testcase_25 AC 32 ms
9,096 KB
testcase_26 AC 27 ms
9,012 KB
testcase_27 AC 32 ms
9,100 KB
testcase_28 AC 29 ms
8,968 KB
testcase_29 AC 32 ms
9,080 KB
testcase_30 AC 29 ms
8,976 KB
testcase_31 AC 29 ms
9,028 KB
testcase_32 AC 28 ms
9,044 KB
testcase_33 AC 27 ms
8,944 KB
testcase_34 AC 29 ms
8,956 KB
testcase_35 AC 28 ms
8,940 KB
testcase_36 AC 25 ms
8,892 KB
testcase_37 AC 21 ms
8,856 KB
testcase_38 AC 26 ms
8,972 KB
testcase_39 AC 21 ms
8,856 KB
testcase_40 AC 28 ms
8,976 KB
testcase_41 AC 21 ms
8,788 KB
testcase_42 AC 28 ms
8,896 KB
testcase_43 AC 21 ms
8,956 KB
testcase_44 AC 26 ms
8,968 KB
testcase_45 AC 21 ms
8,804 KB
testcase_46 AC 23 ms
8,952 KB
testcase_47 AC 20 ms
8,840 KB
testcase_48 AC 28 ms
8,904 KB
testcase_49 AC 20 ms
8,796 KB
testcase_50 AC 28 ms
9,092 KB
testcase_51 AC 21 ms
8,816 KB
testcase_52 AC 27 ms
8,972 KB
testcase_53 AC 20 ms
8,860 KB
testcase_54 AC 27 ms
8,956 KB
testcase_55 AC 21 ms
8,804 KB
testcase_56 AC 23 ms
9,016 KB
testcase_57 AC 21 ms
8,804 KB
testcase_58 AC 22 ms
8,952 KB
testcase_59 AC 21 ms
8,752 KB
testcase_60 AC 25 ms
8,944 KB
testcase_61 AC 20 ms
8,764 KB
testcase_62 AC 23 ms
9,092 KB
testcase_63 AC 20 ms
8,904 KB
testcase_64 AC 22 ms
8,936 KB
testcase_65 AC 20 ms
8,816 KB
testcase_66 AC 30 ms
9,096 KB
testcase_67 AC 21 ms
8,712 KB
testcase_68 AC 28 ms
8,956 KB
testcase_69 AC 22 ms
8,904 KB
testcase_70 AC 25 ms
8,972 KB
testcase_71 AC 22 ms
8,804 KB
testcase_72 AC 26 ms
9,032 KB
testcase_73 AC 21 ms
8,756 KB
testcase_74 AC 28 ms
9,084 KB
testcase_75 AC 20 ms
8,892 KB
testcase_76 AC 21 ms
8,916 KB
testcase_77 AC 21 ms
8,896 KB
testcase_78 AC 21 ms
8,752 KB
testcase_79 AC 21 ms
8,724 KB
testcase_80 AC 21 ms
8,856 KB
testcase_81 AC 21 ms
8,868 KB
testcase_82 WA -
testcase_83 AC 21 ms
8,860 KB
testcase_84 AC 30 ms
8,956 KB
testcase_85 AC 39 ms
8,936 KB
testcase_86 AC 21 ms
8,816 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from itertools import *
from bisect import *
from collections import *
from heapq import *
import sys

sys.setrecursionlimit(10 ** 6)

def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def SI(): return sys.stdin.readline()[:-1]
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def LLI1(rows_number): return [LI1() for _ in range(rows_number)]
int1 = lambda x: int(x) - 1
def MI1(): return map(int1, sys.stdin.readline().split())
def LI1(): return list(map(int1, sys.stdin.readline().split()))
p2D = lambda x: print(*x, sep="\n")
dij = [(1, 0), (0, 1), (-1, 0), (0, -1)]

def main():
    def ng():
        print(-1)
        exit()

    a,b,c,d=MI()
    # aを村0「だけ」から、水を受け取る村の数
    # bを村1「だけ」から、水を受け取る村の数にする
    a-=c
    b-=c
    # すべての村が0,1から受け取る
    if a==0 and b==0:
        if c>d:ng()
        print(a+b+c,c)
        print(0,1)
        print(1,0)
        for i in range(2,c):
            print(1,i)
    # 村1「だけ」から受け取る村の数がない
    elif b==0:
        if a+c-1>d:ng()
        print(a+b+c,a+c-1)
        print(0,1)
        for i in range(2,a+1):
            print(0,i)
        for i in range(a+1,a+c):
            print(1,i)
    # 村0「だけ」から受け取る村の数がない
    elif a==0:
        if b+c-1>d:ng()
        print(a+b+c,b+c-1)
        print(1,0)
        for i in range(2,b+1):
            print(1,i)
        for i in range(b+1,b+c):
            print(0,i)
    # 両方から受け取る村がない
    elif c==0:
        if a+b-2>d:ng()
        print(a+b+c,a+b-2)
        for i in range(2,a+1):
            print(0,i)
        for i in range(a+1,a+b):
            print(1,i)
    # 全パターンある
    else:
        if a+b+c-1>d:ng()
        print(a+b+c,a+b+c-1)
        print(0,2)
        print(1,2)
        for i in range(3,2+a):
            print(0,i)
        for i in range(2+a,1+a+b):
            print(1,i)
        for i in range(1+a+b,a+b+c):
            print(2,i)

main()
0