結果
| 問題 | No.495 (^^*) Easy |
| コンテスト | |
| ユーザー |
mannshi222
|
| 提出日時 | 2022-04-28 20:29:57 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.90.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 436 bytes |
| 記録 | |
| コンパイル時間 | 376 ms |
| コンパイル使用メモリ | 79,980 KB |
| 実行使用メモリ | 6,400 KB |
| 最終ジャッジ日時 | 2026-06-25 20:46:49 |
| 合計ジャッジ時間 | 1,210 ms |
|
ジャッジサーバーID (参考情報) |
judge1_1 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 7 |
ソースコード
#include <iostream>
#include <cstring>
#include <string>
using namespace std;
int main()
{
char S[100000+1];
cin >> S;
/*
(^^*)が左向きで、
(*^^)が右向きです。
*/
char *s;
int cnt = 0;
s = S;
cnt = 0;
while( ( s = strstr( s, "*)") )!= NULL ) {
cnt++;
s+=1;
}
cout << cnt << " ";
cnt = 0;
s = S;
while( ( s = strstr( s, "(*") )!= NULL ) {
cnt++;
s+=1;
}
cout << cnt << endl;
return 0;
}
mannshi222