結果
問題 |
No.505 カードの数式2
|
ユーザー |
![]() |
提出日時 | 2017-04-21 23:18:10 |
言語 | Java (openjdk 23) |
結果 |
WA
|
実行時間 | - |
コード長 | 532 bytes |
コンパイル時間 | 4,039 ms |
コンパイル使用メモリ | 74,456 KB |
実行使用メモリ | 54,428 KB |
最終ジャッジ日時 | 2024-07-20 17:42:55 |
合計ジャッジ時間 | 8,300 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 3 |
other | AC * 5 WA * 24 |
ソースコード
package javacode; import java.util.Scanner; public class yukicoder2 { public static void main(String args[]){ Scanner cin = new Scanner(System.in); int target = cin.nextInt(); long tmp[] =new long[target]; long result=0; for(int i=0;i<target;i++){ tmp[i] = cin.nextLong(); } for(int k=0;k<target;k++){ if(k==0){ result = tmp[0]; }else if(tmp[k]==0L){ }else{ if(tmp[k]<1L){ result += Math.abs(tmp[k]); }else{ result *= tmp[k]; } } } System.out.println(result); } }