結果

問題 No.495 (^^*) Easy
ユーザー shioyashioya
提出日時 2018-07-21 23:32:17
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 5 ms / 2,000 ms
コード長 561 bytes
コンパイル時間 1,536 ms
コンパイル使用メモリ 52,044 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-08-27 00:48:06
合計ジャッジ時間 1,056 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 1 ms
4,376 KB
testcase_04 AC 2 ms
4,380 KB
testcase_05 AC 2 ms
4,376 KB
testcase_06 AC 5 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

//No.495 (^^*) Easy
#include<iostream>
#include<string>
using namespace std;
int main()
{
	string S;
	cin >> S;
	string tmp_str;
	int face_[2] = {0,0};
	bool load_f = false;
	for (int i = 0; i < S.length(); i++) {
		if (S[i] == '(') load_f = true;
		if (load_f) {
			tmp_str += S[i];
			if (S[i] == ')')load_f = false;
		}
		if (tmp_str == "(^^*)") {
			face_[0]++;
			load_f = false;
			tmp_str.clear();
		}
		else if (tmp_str == "(*^^)") {
			face_[1]++;
			load_f = false;
			tmp_str.clear();
		}
	}
	cout << face_[0] << " " << face_[1] << endl;
	return 0;
}
0