結果

問題 No.342 一番ワロタww
ユーザー dnishdnish
提出日時 2018-06-16 19:33:21
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,063 bytes
コンパイル時間 1,524 ms
コンパイル使用メモリ 168,308 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-13 06:15:14
合計ジャッジ時間 2,443 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include "bits/stdc++.h"
#define REP(i,n,N) for(ll i=(n); i<(N); i++)
#define RREP(i,n,N) for(ll i=(N-1); i>=n; i--)
#define CK(n,a,b) ((a)<=(n)&&(n)<(b))
#define ALL(v) (v).begin(),(v).end()
#define p(s) cout<<(s)<<endl
#define p2(a,b) cout<<(a)<<" "<<(b)<<endl
typedef long long ll;
using namespace std;
const ll inf=LONG_LONG_MAX;


string S;

int main(){

    while(cin>>S){
        int cnt=0;
        string ans;
        vector<string> vans;
        string w="w";
        bool f=false;
        for(int i=0;i<=S.size()-3;i+=3){
            string now = S.substr(i,3);
            if(now==w){
                cnt++;
                if(ans.size()>0&&cnt>1){
                    p(ans);
                    ans="";
                    f=true;
                }
            }else{
                if(cnt>0){
                    ans="";
                    cnt=0;
                }
                ans+=now;
            }
        }
        if(ans.size()>0&&cnt>1){
            p(ans);
        }
        if(!f){
            p("");
        }
    }

    return 0;
}
0