結果
問題 | No.495 (^^*) Easy |
ユーザー |
![]() |
提出日時 | 2018-03-06 05:30:29 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 4 ms / 2,000 ms |
コード長 | 457 bytes |
コンパイル時間 | 731 ms |
コンパイル使用メモリ | 81,216 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-09-14 13:28:00 |
合計ジャッジ時間 | 1,576 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 7 |
ソースコード
#include<iostream>#include<string>#include<algorithm>#include<cmath>#include<iomanip>#include<cstring>#include<map>#include<vector>#include<queue>using namespace std;typedef long long ll;int main(){string s;cin >> s;int ans1=0, ans2=0;for(int i=0; i<s.size(); i++){if(s[i]=='*' && s[i+1]==')'){ans1++;}if(s[i]=='(' && s[i+1]=='*'){ans2++;}}cout << ans1 << " " << ans2 << endl;return 0;}