結果
| 問題 |
No.505 カードの数式2
|
| ユーザー |
|
| 提出日時 | 2017-04-21 22:46:21 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 327 bytes |
| コンパイル時間 | 677 ms |
| コンパイル使用メモリ | 60,776 KB |
| 実行使用メモリ | 6,948 KB |
| 最終ジャッジ日時 | 2024-07-20 05:36:29 |
| 合計ジャッジ時間 | 1,286 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 10 WA * 19 |
ソースコード
#include<iostream>
#include<math.h>
#include<vector>
using namespace std;
int main(){
double n;
double now;
double a;
cin >> n;
cin >> a;
now = a;
for(int i=1;i<n;i++){
cin >> a;
if(a > 1){
now *= a;
}else if(a == 1){
now++;
}else{
now -= a;
}
}
cout << now << endl;
}