結果
| 問題 |
No.204 ゴールデン・ウィーク(2)
|
| コンテスト | |
| ユーザー |
srup٩(๑`н´๑)۶
|
| 提出日時 | 2016-08-16 21:29:07 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 795 bytes |
| コンパイル時間 | 552 ms |
| コンパイル使用メモリ | 63,384 KB |
| 実行使用メモリ | 6,824 KB |
| 最終ジャッジ日時 | 2024-11-07 18:22:11 |
| 合計ジャッジ時間 | 1,780 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 3 |
| other | WA * 46 |
ソースコード
#include <iostream>
#include <vector>
#include <cstdio>
#include <string>
#include <cstring>
#include <algorithm>
using namespace std;
#define rep(i,n) for(int i=0;i<(n);i++)
int main(void){
int n; cin >> n;
string s1, s2; cin >> s1 >> s2;
string s = "xxxxxxxxxxxxxxx" + s1 + s2 + "xxxxxxxxxxxxxxx";
int ans = 0, tmp = 0;
for (int i = 0; i < 44 - n; ++i){
tmp = 0;
string t = s;
for (int j = i; j < i + n; ++j){
if(t[j] == 'x') t[j] = 'o';
else break;
}
cout << t << endl;
rep(j, t.size()){
// printf("%d\n", tmp);
if(t[j] == 'o') tmp++;
else{
// printf("i %d\n", i);
ans = max(tmp, ans);
tmp = 0;
}
if(j == t.size() - 1){
ans = max(tmp, ans);
}
}
// printf("%d ", ans);
// cout << t << endl;
}
cout << ans << endl;
return 0;
}
srup٩(๑`н´๑)۶