結果
| 問題 |
No.451 575
|
| コンテスト | |
| ユーザー |
fal_rnd
|
| 提出日時 | 2016-12-02 20:48:57 |
| 言語 | Java (openjdk 23) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 520 bytes |
| コンパイル時間 | 2,353 ms |
| コンパイル使用メモリ | 75,272 KB |
| 実行使用メモリ | 56,460 KB |
| 最終ジャッジ日時 | 2024-12-16 10:40:51 |
| 合計ジャッジ時間 | 11,352 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 21 WA * 8 |
ソースコード
package src;
import java.util.*;
class B{
static Scanner s = new Scanner(System.in);
public static void main(String[] args) {
long[] out = new long[s.nextInt()+1];
out[0]=1;
long buf=1;
for(int i=1;i<out.length;++i) {
if(i%2==0) {
buf=(out[i]=buf-Long.parseLong(s.next()));
}else {
buf=(out[i]=Long.parseLong(s.next())-buf);
}
if(buf<=0){
System.out.println(-1);
return;
}
}
System.out.println(out.length);
for(int i=0;i<out.length;i++)
System.out.println(out[i]);
}
}
fal_rnd