結果
問題 |
No.197 手品
|
ユーザー |
![]() |
提出日時 | 2017-05-03 11:41:22 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 440 bytes |
コンパイル時間 | 1,377 ms |
コンパイル使用メモリ | 168,212 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-20 03:51:56 |
合計ジャッジ時間 | 2,514 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 43 |
ソースコード
#include <bits/stdc++.h> #define p(s) cout<<(s)<<endl using namespace std; int main(){ string sb,sa,ans="FAILURE"; int N; cin>>sb>>N>>sa; string rsb=sb; reverse(rsb.begin(),rsb.end()); int cntb=count(sb.begin(),sb.end(),'o'); int cnta=count(sa.begin(),sa.end(),'o'); if(N==0 && sa!=sb) ans="SUCCESS"; else if(cnta!=cntb) ans="SUCCESS"; else if(cnta==1 || cnta==2){ if(N==1 && sa==rsb) ans="SUCCESS"; } p(ans); return 0; }