結果

問題 No.341 沈黙の期間
ユーザー IchimiyaIchimiya
提出日時 2020-08-02 02:41:22
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 558 bytes
コンパイル時間 2,237 ms
コンパイル使用メモリ 168,336 KB
実行使用メモリ 4,500 KB
最終ジャッジ日時 2023-09-23 02:04:12
合計ジャッジ時間 3,268 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <bits/stdc++.h>
#define PI 3.14159265359
#define NIL -1
using namespace std;
const int64_t MOD = 1e9 + 7;

int main() {
	string S;
	cin >> S;
	//cout << S << endl;

	vector<int> v;
	for (int i = 0; i < S.size(); i++) {
		char ch = S.at(i);
		int n = (int)ch;
		//cout << n << endl;
		v.push_back(n);
	}

	int cnt = 0;
	int MAX = 0;
	for (int i = 0; i < v.size()-1; i+=2) {
		int a, b;
		a = v.at(i);
		b = v.at(i + 1);

		if ((a == -127) && (b == 99)) {
			cnt++;
		}
		else {
			if (cnt > MAX) MAX = cnt;
			cnt = 0;
		}
	}

	cout << cnt << endl;
}
0