結果
問題 | No.341 沈黙の期間 |
ユーザー |
![]() |
提出日時 | 2016-02-13 22:54:58 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 419 bytes |
コンパイル時間 | 403 ms |
コンパイル使用メモリ | 55,636 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-09-22 06:18:14 |
合計ジャッジ時間 | 1,007 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 11 |
ソースコード
#include <iostream> #include <string> using namespace std; int main(){ string dots = "…"; string str; cin >> str; int cnt = 0; int mx = 0; while (!str.empty()) { if (!str.compare(0,3,dots)) cnt++; else { mx = max(cnt,mx); cnt = 0; } str.replace(0,3,""); } cnt = max(cnt,mx); cout << cnt << endl; return 0; }