結果
| 問題 | 
                            No.341 沈黙の期間
                             | 
                    
| コンテスト | |
| ユーザー | 
                             kei
                         | 
                    
| 提出日時 | 2016-08-17 23:05:51 | 
| 言語 | C++11(廃止可能性あり)  (gcc 13.3.0)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 510 bytes | 
| コンパイル時間 | 437 ms | 
| コンパイル使用メモリ | 57,428 KB | 
| 実行使用メモリ | 5,248 KB | 
| 最終ジャッジ日時 | 2024-11-07 19:04:26 | 
| 合計ジャッジ時間 | 1,035 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge4 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | WA * 3 | 
| other | AC * 3 WA * 8 | 
ソースコード
#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;
}
            
            
            
        
            
kei