結果
問題 | No.451 575 |
ユーザー | ryusuke |
提出日時 | 2023-07-09 19:03:37 |
言語 | Python3 (3.12.2 + numpy 1.26.4 + scipy 1.12.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 661 bytes |
コンパイル時間 | 69 ms |
コンパイル使用メモリ | 10,908 KB |
実行使用メモリ | 12,988 KB |
最終ジャッジ日時 | 2023-09-30 22:39:02 |
合計ジャッジ時間 | 6,614 ms |
ジャッジサーバーID (参考情報) |
judge15 / judge11 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | WA | - |
testcase_01 | WA | - |
testcase_02 | WA | - |
testcase_03 | WA | - |
testcase_04 | WA | - |
testcase_05 | AC | 26 ms
8,408 KB |
testcase_06 | AC | 50 ms
8,956 KB |
testcase_07 | AC | 193 ms
12,900 KB |
testcase_08 | WA | - |
testcase_09 | WA | - |
testcase_10 | WA | - |
testcase_11 | WA | - |
testcase_12 | WA | - |
testcase_13 | WA | - |
testcase_14 | AC | 15 ms
8,104 KB |
testcase_15 | AC | 22 ms
8,316 KB |
testcase_16 | AC | 44 ms
8,852 KB |
testcase_17 | AC | 193 ms
12,880 KB |
testcase_18 | AC | 190 ms
12,944 KB |
testcase_19 | AC | 132 ms
11,424 KB |
testcase_20 | WA | - |
testcase_21 | WA | - |
testcase_22 | WA | - |
testcase_23 | WA | - |
testcase_24 | WA | - |
testcase_25 | WA | - |
testcase_26 | AC | 15 ms
8,280 KB |
testcase_27 | AC | 16 ms
8,136 KB |
testcase_28 | AC | 17 ms
8,272 KB |
testcase_29 | AC | 34 ms
8,568 KB |
testcase_30 | AC | 193 ms
12,968 KB |
testcase_31 | WA | - |
testcase_32 | AC | 75 ms
9,688 KB |
ソースコード
# verification-helper: PROBLEM https://yukicoder.me/problems/no/451 def main() -> None: n = int(input()) b = [int(input()) for _ in range(n)] i, mid = 0, 0 a = [1] * (n + 1) while i < n: if i % 2: a[i + 1] = a[i] - b[i] else: a[i + 1] = a[i] + b[i] if a[i + 1] <= 0 or a[i + 1] > 10**18: a[0] += - a[i + 1] + 1 i = -1 mid += 1 if mid == 10: exit(print(-1)) i += 1 if a[0] <= 0: exit(print(-1)) print(n + 1) for i in range(n + 1): print(a[i]) if __name__ == "__main__": main()