結果
問題 | No.341 沈黙の期間 |
ユーザー |
|
提出日時 | 2017-11-25 00:38:23 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 391 bytes |
コンパイル時間 | 568 ms |
コンパイル使用メモリ | 66,580 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-27 08:55:31 |
合計ジャッジ時間 | 1,181 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 11 |
ソースコード
#include <iostream> #include <algorithm> using namespace std; int main(){ string S; cin >> S; int serial = 0; int ans = 0; for(int i = 0; i < S.size(); i++){ if(S[i] == -30){ serial++; i += 2; }else{ ans = max(ans, serial); serial = 0; } } ans = max(ans, serial); cout << ans << endl; }