結果
| 問題 |
No.495 (^^*) Easy
|
| コンテスト | |
| ユーザー |
f843nmfwisfeuw
|
| 提出日時 | 2020-08-12 16:56:25 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 554 bytes |
| コンパイル時間 | 855 ms |
| コンパイル使用メモリ | 92,788 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-10-09 18:30:22 |
| 合計ジャッジ時間 | 1,372 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | WA * 7 |
コンパイルメッセージ
main.cpp: In function 'int main()':
main.cpp:34:25: warning: 'R' may be used uninitialized [-Wmaybe-uninitialized]
34 | cout << L << " " << R << endl;
| ^
main.cpp:22:12: note: 'R' was declared here
22 | int L, R;
| ^
main.cpp:34:18: warning: 'L' may be used uninitialized [-Wmaybe-uninitialized]
34 | cout << L << " " << R << endl;
| ^~~
main.cpp:22:9: note: 'L' was declared here
22 | int L, R;
| ^
ソースコード
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <stack>
#include <algorithm>
#include <string>
#include <map>
#include <iterator>
#include <set>
#include <queue>
using namespace std;
int main() {
string S;
cin >> S;
int L, R;
for (int i = 0; i < S.size(); ++i) {
string subst = S.substr(i, 2);
if (subst == "*)") {
L += 1;
} else if (subst == "(*") {
R += 1;
}
}
cout << L << " " << R << endl;
return 0;
}
f843nmfwisfeuw