結果
問題 | No.341 沈黙の期間 |
ユーザー |
|
提出日時 | 2019-07-30 13:18:03 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 386 bytes |
コンパイル時間 | 1,731 ms |
コンパイル使用メモリ | 193,272 KB |
最終ジャッジ日時 | 2025-01-07 10:06:04 |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 11 |
ソースコード
#include <bits/stdc++.h>using namespace std;typedef long long ll;int main() {string t = "…";string s;cin >> s;int ans = 0;int cnt = 0;for (int i = 0; i+2 < s.size(); i++) {if (s.substr(i, 3) == t) {cnt++;ans = max(ans, cnt);i += 2;} else cnt = 0;}cout << ans << endl;return 0;}