結果

問題 No.341 沈黙の期間
ユーザー legosuke
提出日時 2017-11-13 10:41:41
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 367 bytes
コンパイル時間 1,271 ms
コンパイル使用メモリ 161,716 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-11-25 00:23:33
合計ジャッジ時間 1,776 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 11
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;

int main(void) {
  string s;
  cin >> s;

  int ans = 0, sz = s.size(), l = 0, r = 0;
  while (l < sz) {
    while (l < sz && s.substr(l, 3) != "…") l += 3, r += 3;
    while (r < sz && s.substr(r, 3) == "…") r += 3;
    ans = max(ans, (r - l) / 3);
    r += 3;
    l = r;
  }
  cout << ans << endl;

  return 0;
}
0