結果

問題 No.204 ゴールデン・ウィーク(2)
ユーザー sugim48sugim48
提出日時 2015-05-08 22:26:52
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 1,312 bytes
コンパイル時間 731 ms
コンパイル使用メモリ 95,048 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-04-21 12:54:53
合計ジャッジ時間 1,794 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 2 ms
5,376 KB
testcase_02 AC 2 ms
5,376 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 1 ms
5,376 KB
testcase_06 WA -
testcase_07 AC 2 ms
5,376 KB
testcase_08 WA -
testcase_09 AC 2 ms
5,376 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 2 ms
5,376 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 2 ms
5,376 KB
testcase_19 WA -
testcase_20 AC 2 ms
5,376 KB
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 AC 2 ms
5,376 KB
testcase_29 WA -
testcase_30 AC 2 ms
5,376 KB
testcase_31 AC 1 ms
5,376 KB
testcase_32 AC 1 ms
5,376 KB
testcase_33 AC 1 ms
5,376 KB
testcase_34 WA -
testcase_35 AC 2 ms
5,376 KB
testcase_36 AC 1 ms
5,376 KB
testcase_37 WA -
testcase_38 AC 2 ms
5,376 KB
testcase_39 AC 2 ms
5,376 KB
testcase_40 WA -
testcase_41 AC 2 ms
5,376 KB
testcase_42 AC 2 ms
5,376 KB
testcase_43 AC 1 ms
5,376 KB
testcase_44 WA -
testcase_45 AC 1 ms
5,376 KB
testcase_46 AC 2 ms
5,376 KB
testcase_47 WA -
testcase_48 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#define _USE_MATH_DEFINES
#include <algorithm>
#include <cstdio>
#include <functional>
#include <iostream>
#include <cfloat>
#include <climits>
#include <cstring>
#include <cmath>
#include <fstream>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <time.h>
#include <vector>
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> i_i;
typedef pair<ll, int> ll_i;
typedef pair<double, int> d_i;
typedef pair<ll, ll> ll_ll;
typedef pair<double, double> d_d;
struct edge { int v, w; };

ll MOD = 1000000007;
ll _MOD = 1000000009;
double EPS = 1e-10;

int f(string& s) {
	int maxi = 0;
	for (int i = 0; i <= 14; i++)
		for (int j = i; j <= 28; j++) {
			bool ok = true;
			for (int k = i; k < j; k++)
				if (s[k] == 'x')
					ok = false;
			if (ok) maxi = max(maxi, j - i);
		}
	return maxi;
}

int main() {
	int D; cin >> D;
	string s, t; cin >> s >> t;
	s = "xxxxxxxxxxxxxx" + s + t + "xxxxxxxxxxxxxx";
	int maxi = 0;
	for (int d = 0; d <= D; d++) {
		for (int i = 0; i + d <= 28; i++) {
			bool ok = true;
			string _s = s;
			for (int j = i; j < i + d; j++) {
				if (_s[j] == 'o') ok = false;
				else _s[j] = 'o';
			}
			if (ok) maxi = max(maxi, f(_s));
		}
	}
	cout << maxi << endl;
}
0