結果
| 問題 |
No.451 575
|
| コンテスト | |
| ユーザー |
fal_rnd
|
| 提出日時 | 2016-12-02 00:20:29 |
| 言語 | Java (openjdk 23) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 574 bytes |
| コンパイル時間 | 2,436 ms |
| コンパイル使用メモリ | 74,456 KB |
| 実行使用メモリ | 43,716 KB |
| 最終ジャッジ日時 | 2024-12-16 07:38:45 |
| 合計ジャッジ時間 | 12,488 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 4 RE * 25 |
ソースコード
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;
for(int i=0;i<out.length-1;++i) {
if(i%2==0) {
out[i+1]=Integer.parseInt(s.next())-out[i];
}else {
out[i+1]=out[i]-Integer.parseInt(s.next());
}
}
boolean f=false;
for(int i=0;i<out.length;i++)
f|=(out[i]<=0);
if(f)
System.out.println(-1);
else {
System.out.println(out.length);
for(int i=0;i<out.length;i++)
System.out.println(out[i]);
}
}
}
fal_rnd