結果

問題 No.451 575
ユーザー sette-pianisette-piani
提出日時 2017-01-23 16:21:42
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 604 bytes
コンパイル時間 881 ms
コンパイル使用メモリ 10,852 KB
実行使用メモリ 12,880 KB
最終ジャッジ日時 2023-08-24 21:27:49
合計ジャッジ時間 4,624 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,764 KB
testcase_01 AC 15 ms
7,828 KB
testcase_02 AC 15 ms
7,752 KB
testcase_03 AC 15 ms
7,928 KB
testcase_04 AC 15 ms
7,948 KB
testcase_05 AC 15 ms
7,828 KB
testcase_06 AC 15 ms
7,916 KB
testcase_07 AC 15 ms
7,856 KB
testcase_08 AC 15 ms
7,856 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 264 ms
12,880 KB
testcase_14 AC 15 ms
7,748 KB
testcase_15 AC 15 ms
7,760 KB
testcase_16 AC 15 ms
7,832 KB
testcase_17 AC 15 ms
7,852 KB
testcase_18 AC 15 ms
7,784 KB
testcase_19 AC 15 ms
7,864 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 15 ms
7,772 KB
testcase_23 WA -
testcase_24 WA -
testcase_25 AC 15 ms
7,860 KB
testcase_26 AC 15 ms
7,864 KB
testcase_27 AC 15 ms
7,892 KB
testcase_28 AC 15 ms
7,832 KB
testcase_29 AC 16 ms
7,836 KB
testcase_30 AC 15 ms
7,764 KB
testcase_31 AC 15 ms
7,748 KB
testcase_32 AC 15 ms
7,884 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def main():
    n = int(input())
    a = [1]
    for i in range(n):
        add = int(input()) - a[i] if i%2 == 0 else a[i] - int(input())
        if add >= 1:
            a.append(add)
        else:
            break
    if len(a) != n+1:
        print(-1)
    else:
        print(n+1)
        [print(i) 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