結果
| 問題 |
No.203 ゴールデン・ウィーク(1)
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2015-05-08 22:23:43 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 1,000 ms |
| コード長 | 692 bytes |
| コンパイル時間 | 1,136 ms |
| コンパイル使用メモリ | 162,124 KB |
| 実行使用メモリ | 6,824 KB |
| 最終ジャッジ日時 | 2024-11-18 08:54:34 |
| 合計ジャッジ時間 | 1,930 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 29 |
ソースコード
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
#define fr(i, a, b) for (int i = (a); i < (b); i++)
using namespace std;
typedef long long ll;
const ll inf = 1e9;
const ll mod = 1e9 + 7;
int main() {
string s[2];
cin >> s[0] >> s[1];
string w = s[0] + s[1];
int ans = 0;
for (int i = 0; i < w.length(); i++) {
for (int j = 0; j < w.length() - i; j++) {
string sub = w.substr(i, j + 1);
bool f = true;
for (int k = 0; k < sub.length(); k++) {
if (sub[k] == 'x') f = false;
}
if (f) ans = max(ans, (int)sub.length());
}
}
cout << ans << endl;
}