結果

問題 No.342 一番ワロタww
ユーザー aaaaaaiuaaaaaaiu
提出日時 2019-08-14 22:46:08
言語 C++17
(gcc 13.2.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 755 bytes
コンパイル時間 2,342 ms
コンパイル使用メモリ 207,992 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-19 18:16:30
合計ジャッジ時間 3,615 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ(β)

テストケース

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

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

int main() {
    string s;
    cin>>s;
    int n=s.size();
    vector<string> ss;
    vector<int> w;
    int i=0;
    while (s.substr(i,3)=="w") i+=3;
    while (i<n) {
        string t;
        while (i<n&&s.substr(i,3)!="w") {
            t+=s.substr(i,3);
            i+=3;
        }
        ss.push_back(t);
        int cnt=0;
        while (i<n&&s.substr(i,3)=="w") {
            cnt++;
            i+=3;
        }
        w.push_back(cnt);
    }
    int mx=0;
    for (int x:w) mx=max(mx,x);
    if (mx==0) {
        cout<<endl;
        return 0;
    }
    for (int i=0;i<w.size();i++) {
        if (w[i]==mx) {
            cout<<ss[i]<<endl;
        }
    }
    return 0;
}
0