結果

問題 No.204 ゴールデン・ウィーク(2)
コンテスト
ユーザー phspls
提出日時 2020-04-12 21:39:45
言語 C++14
(gcc 15.3.0 + boost 1.92.0 + ACL)
コンパイル:
g++-15 -O2 -lm -std=c++14 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
WA  
実行時間 -
コード長 635 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 1,723 ms
コンパイル使用メモリ 180,984 KB
実行使用メモリ 9,776 KB
最終ジャッジ日時 2026-09-02 10:25:22
合計ジャッジ時間 3,127 ms
ジャッジサーバーID
(参考情報)
judge3_1 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 21 WA * 25
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define llong long long

int getlen(string w) {
    int ret = 0;
    int temp = 0;
    for(char c: w) {
        if(c == 'o') {
            temp += 1;
        } else {
            temp = 0;
        }
        ret = max(ret, temp);
    }
    return ret;
}

int main() {
    int d;
    string base,s2;
    cin >> d;
    cin >> base >> s2;
    base += s2;

    int result = 0;
    rep(i, 14+1-d) {
        string temp = base;
        rep(j, d) temp[j+i] = 'o';
        result = max(result, getlen(temp));
    }

    cout << result << "\n";
}
0