結果

問題 No.341 沈黙の期間
ユーザー satanicsatanic
提出日時 2016-02-17 21:30:39
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 486 bytes
コンパイル時間 409 ms
コンパイル使用メモリ 56,680 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-22 06:19:31
合計ジャッジ時間 1,128 ms
ジャッジサーバーID
(参考情報)
judge10 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,348 KB
testcase_01 AC 1 ms
4,348 KB
testcase_02 AC 2 ms
4,348 KB
testcase_03 AC 1 ms
4,348 KB
testcase_04 AC 2 ms
4,348 KB
testcase_05 AC 1 ms
4,348 KB
testcase_06 AC 2 ms
4,348 KB
testcase_07 AC 2 ms
4,348 KB
testcase_08 AC 2 ms
4,348 KB
testcase_09 AC 2 ms
4,348 KB
testcase_10 AC 2 ms
4,348 KB
testcase_11 AC 2 ms
4,348 KB
testcase_12 AC 2 ms
4,348 KB
testcase_13 AC 2 ms
4,348 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <string>

int main(){
  std::ios::sync_with_stdio(false);
  std::cin.tie(0);

  int cnt=0, max=-1;
  char c;
  std::string multiChar;
  while(1){
    multiChar.clear();
    for(int i=0; i<3; ++i){
      std::cin.get(c);
      multiChar.push_back(c);
      if(c=='\n') break;
    }
    if(multiChar=="…") ++cnt;
    else{
      max = (max < cnt) ? cnt : max;
      cnt=0;
    }
    if(multiChar=="\n") break;
  }

  std::cout << max << "\n";

  return 0;
}
0