結果
問題 |
No.341 沈黙の期間
|
ユーザー |
|
提出日時 | 2016-02-12 23:05:40 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 860 bytes |
コンパイル時間 | 636 ms |
コンパイル使用メモリ | 86,316 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-09-22 04:50:56 |
合計ジャッジ時間 | 1,192 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 3 |
other | AC * 2 WA * 9 |
ソースコード
#include<iostream> #include<cstdio> #include<cstring> #include<string> #include<algorithm> #include<bitset> #include<vector> #include<deque> #include<queue> #include<map> #include<set> #include<stack> #include<cmath> #include<iomanip> #include <functional> using namespace std; typedef long long ll; //-------------------------- int main() { string s; string ss = "…"; cin >> s; int max = 0; int ans = 0; int i = 0; while (i < s.size()-2) { if ((int)s[i] == -127 && (int)s[i+1] == 99) { ans++; i += 2; } else { if (max < ans) max = ans; ans = 0; i++; } } if (max < ans) max = ans; i = 1; while (i < s.size() - 2) { if ((int)s[i] == -127 && (int)s[i + 1] == 99) { ans++; i += 2; } else { if (max < ans) max = ans; ans = 0; i++; } } if (max < ans) max = ans; cout << max << endl; return 0; }