結果

問題 No.341 沈黙の期間
ユーザー keikei
提出日時 2016-08-17 23:05:51
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 510 bytes
コンパイル時間 378 ms
コンパイル使用メモリ 57,304 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-25 08:36:18
合計ジャッジ時間 915 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 AC 1 ms
5,376 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 2 ms
5,376 KB
testcase_12 WA -
testcase_13 AC 2 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 pos = 0,next_pos = 0;
	int len = 0;
	string str;
	cin >> str;

	while ((next_pos = (str.find("…",pos))) != string::npos) {
		if (next_pos - pos == 1) {
			temp_ans++;
			pos = next_pos + 1;
		}
		else {
			ans = max(ans, temp_ans);
			temp_ans = 1;
			pos = next_pos + 1;
		}
	}
	ans = max(ans, temp_ans);
	cout << ans << endl;
	return 0;
}
0