結果
問題 |
No.451 575
|
ユーザー |
![]() |
提出日時 | 2016-12-02 10:25:47 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 287 bytes |
コンパイル時間 | 318 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 18,560 KB |
最終ジャッジ日時 | 2024-12-16 10:09:10 |
合計ジャッジ時間 | 9,223 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 21 WA * 7 TLE * 1 |
ソースコード
n=int(input()) b=[int(input()) for _ in range(n)] i=m=0 a=[1]*(n+1) while i<n: if i%2:a[i+1]=a[i]-b[i] else:a[i+1]=b[i]-a[i] if a[i+1]<=0 or a[i+1]>10**18:a[0]=-a[i+1]+1;i=-1;m+=1 if m==100:print(-1);exit() i+=1 if a[0]<=0:print(-1);exit() print(n+1) for _ in range(n+1):print(a[_])