結果
問題 |
No.505 カードの数式2
|
ユーザー |
![]() |
提出日時 | 2017-04-21 23:09:38 |
言語 | Java (openjdk 23) |
結果 |
WA
|
実行時間 | - |
コード長 | 553 bytes |
コンパイル時間 | 3,785 ms |
コンパイル使用メモリ | 74,604 KB |
実行使用メモリ | 41,380 KB |
最終ジャッジ日時 | 2024-07-20 15:15:57 |
合計ジャッジ時間 | 8,802 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 11 WA * 18 |
ソースコード
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=0L; for(int i=0;i<target;i++){ tmp[i] = Math.abs(cin.nextLong()); } for(int k=0;k<target;k++){ if(result ==0L && tmp[k]>0L){ result = tmp[k]; }else if(tmp[k]==0L){ }else{ if(tmp[k]==1L){ result += tmp[k]; }else{ result *= tmp[k]; } } } System.out.println(result); } }