結果
| 問題 |
No.49 算数の宿題
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2016-03-29 13:41:26 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 5,000 ms |
| コード長 | 399 bytes |
| コンパイル時間 | 603 ms |
| コンパイル使用メモリ | 58,104 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-12-23 01:50:19 |
| 合計ジャッジ時間 | 1,074 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 10 |
ソースコード
#include <iostream>
#include <vector>
int main(){
std::ios::sync_with_stdio(false);
std::cin.tie(0);
std::vector<int> s(2, -1);
std::cin >> s[0];
while(true){
char tmpChar;
if(!(std::cin >> tmpChar)) break;
std::cin >> s[1];
s[0] = (tmpChar=='*') ? (s[0]+s[1]) : (s[0]*s[1]);
}
std::cout << s[0] << "\n";
return 0;
}