結果
問題 |
No.342 一番ワロタww
|
ユーザー |
![]() |
提出日時 | 2018-06-16 19:33:21 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,063 bytes |
コンパイル時間 | 1,488 ms |
コンパイル使用メモリ | 169,376 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-30 16:25:53 |
合計ジャッジ時間 | 2,333 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 7 WA * 7 |
ソースコード
#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; }