結果

問題 No.341 沈黙の期間
ユーザー keikei
提出日時 2016-08-17 23:56:37
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 509 bytes
コンパイル時間 405 ms
コンパイル使用メモリ 57,300 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-25 08:37:31
合計ジャッジ時間 999 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
int main() {
	cin.tie(0); ios::sync_with_stdio(false);
	int ans = 0, temp_ans = 0;
	int len = 0;
	string str;
	cin >> str;
	len = str.length();
	for (int i = 0; i < len - 2; ) {
		if (str[i] == -30 && str[i + 1] == -128 && str[i + 2]) {
			temp_ans++;
			i += 3;
			int pos = 0, next_pos = 0;
		}
		else {
			ans = max(ans, temp_ans);
			temp_ans = 0;
			i++;
		}
	}
	ans = max(ans, temp_ans);	
	cout << ans << endl;
	return 0;
}
0