結果
| 問題 |
No.505 カードの数式2
|
| コンテスト | |
| ユーザー |
conf
|
| 提出日時 | 2017-04-21 22:35:48 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 328 bytes |
| コンパイル時間 | 554 ms |
| コンパイル使用メモリ | 64,028 KB |
| 実行使用メモリ | 6,948 KB |
| 最終ジャッジ日時 | 2024-07-20 05:28:24 |
| 合計ジャッジ時間 | 1,582 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 10 WA * 19 |
ソースコード
#include <iostream>
using namespace std;
int main(){
int N;
cin>>N;
int ans=0;
while(N--){
int n;
cin>>n;
if(n<0)n=-n;
if(!ans){
ans+=n;
}else if(n>1){
ans*=n;
}else{
ans+=n;
}
}
cout<<ans<<endl;
return 0;
}
conf