結果
| 問題 | No.505 カードの数式2 |
| コンテスト | |
| ユーザー |
akitsu818
|
| 提出日時 | 2017-04-21 23:06:42 |
| 言語 | Java (openjdk 23) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 544 bytes |
| 記録 | |
| コンパイル時間 | 3,556 ms |
| コンパイル使用メモリ | 75,016 KB |
| 実行使用メモリ | 56,320 KB |
| 最終ジャッジ日時 | 2024-07-20 15:13:44 |
| 合計ジャッジ時間 | 9,172 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 10 WA * 19 |
ソースコード
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();
int tmp[] =new int[target];
int result=0;
for(int i=0;i<target;i++){
tmp[i] = Math.abs(cin.nextInt());
}
for(int k=0;k<target;k++){
if(result ==0 && tmp[k]>0){
result = tmp[k];
}else if(tmp[k]==0){
}else{
if(tmp[k]==1){
result += tmp[k];
}else{
result *= tmp[k];
}
}
}
System.out.println(result);
}
}
akitsu818