結果
| 問題 |
No.341 沈黙の期間
|
| コンテスト | |
| ユーザー |
kei
|
| 提出日時 | 2016-08-17 23:56:37 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 5,000 ms |
| コード長 | 509 bytes |
| コンパイル時間 | 475 ms |
| コンパイル使用メモリ | 57,308 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-11-07 19:05:41 |
| 合計ジャッジ時間 | 1,186 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 11 |
ソースコード
#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
int main() {
cin.tie(0); ios::sync_with_stdio(false);
int ans = 0, temp_ans = 0;
int len = 0;
string str;
cin >> str;
len = str.length();
for (int i = 0; i < len - 2; ) {
if (str[i] == -30 && str[i + 1] == -128 && str[i + 2]) {
temp_ans++;
i += 3;
int pos = 0, next_pos = 0;
}
else {
ans = max(ans, temp_ans);
temp_ans = 0;
i++;
}
}
ans = max(ans, temp_ans);
cout << ans << endl;
return 0;
}
kei