結果

問題 No.341 沈黙の期間
ユーザー SSRS
提出日時 2020-08-06 07:57:16
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 271 bytes
コンパイル時間 538 ms
コンパイル使用メモリ 65,060 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-09-19 05:31:05
合計ジャッジ時間 1,263 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample WA * 3
other AC * 2 WA * 9
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp:11:29: warning: multi-character character constant [-Wmultichar]
   11 |                 if (S[i] == '…'){
      |                             ^~~

ソースコード

diff #

#include <iostream>
#include <string>
using namespace std;
int main(){
	string S;
	cin >> S;
	int N = S.size();
	int ans = 0;
	int c = 0;
	for (int i = 0; i < N; i++){
		if (S[i] == '…'){
			c++;
			ans = max(ans, c);
		} else {
			c = 0;
		}
	}
	cout << ans << endl;
}
0