結果

問題 No.451 575
ユーザー sette-pianisette-piani
提出日時 2017-01-23 16:54:14
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 706 bytes
コンパイル時間 100 ms
コンパイル使用メモリ 10,928 KB
実行使用メモリ 18,980 KB
最終ジャッジ日時 2023-08-24 21:30:19
合計ジャッジ時間 8,591 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,780 KB
testcase_01 AC 16 ms
7,764 KB
testcase_02 AC 16 ms
7,784 KB
testcase_03 AC 16 ms
7,772 KB
testcase_04 WA -
testcase_05 AC 28 ms
8,596 KB
testcase_06 WA -
testcase_07 AC 249 ms
18,980 KB
testcase_08 AC 16 ms
7,848 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 297 ms
17,596 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 239 ms
17,460 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 16 ms
7,808 KB
testcase_23 WA -
testcase_24 WA -
testcase_25 AC 16 ms
7,808 KB
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 AC 15 ms
7,812 KB
testcase_32 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

def main():
    n = int(input())
    a = [1]

    for i in range(n):
        a.append(int(input()) - a[i] if i%2 == 0 else a[i] - int(input()))
    a0 = min([a[i] for i in range(n+1) if i % 4 == 0 or i%4 == 3])
    a = list(map(lambda x: x + (1 - a0), a))
    a1 = min([a[i] for i in range(n+1) if i % 4 == 1 or i%4 == 2])
    if a1 < 1:
        print(-1)
    else:
        print(n+1)
        [print(i+1-a0) for i in a]

if __name__ == "__main__":
    import sys
    import os
    if len(sys.argv) > 1:
        if sys.argv[1] == "-d":
            filename = "input1.txt"
            fd = os.open(filename, os.O_RDONLY)
            os.dup2(fd, sys.stdin.fileno())
            main()
    else:
        main()
0