結果
| 問題 |
No.495 (^^*) Easy
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-03-24 22:21:46 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 4 ms / 2,000 ms |
| コード長 | 407 bytes |
| コンパイル時間 | 598 ms |
| コンパイル使用メモリ | 74,728 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-07-06 02:22:58 |
| 合計ジャッジ時間 | 1,247 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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;
}