結果
| 問題 | No.495 (^^*) Easy |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-03-24 22:21:46 |
| 言語 | C++14 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 3 ms / 2,000 ms |
| コード長 | 407 bytes |
| 記録 | |
| コンパイル時間 | 668 ms |
| コンパイル使用メモリ | 90,748 KB |
| 実行使用メモリ | 6,144 KB |
| 最終ジャッジ日時 | 2026-03-27 12:45:09 |
| 合計ジャッジ時間 | 1,619 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 7 |
ソースコード
#include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <vector>
#include <string>
#include <set>
#include <map>
using namespace std;
int main() {
string s;
cin >> s;
int l = 0;
int r = 0;
for (int i = 0; i < s.size() - 1; i++) {
if (s[i] == '(' && s[i + 1] == '*') {
r++;
}
if (s[i] == '*' && s[i + 1] == ')') {
l++;
}
}
cout << l << " " << r << endl;
}