結果
問題 | No.197 手品 |
ユーザー |
|
提出日時 | 2020-04-22 19:22:17 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 3 ms / 1,000 ms |
コード長 | 631 bytes |
コンパイル時間 | 2,180 ms |
コンパイル使用メモリ | 194,088 KB |
最終ジャッジ日時 | 2025-01-09 22:37:30 |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 43 |
ソースコード
#include <bits/stdc++.h> #define rep(i,n) for(int i=0;i<(n);i++) using namespace std; int main(){ string s,t; int n; cin>>s>>n>>t; bool ok; if(n==0){ ok=(s!=t); } else{ ok=(count(s.begin(),s.end(),'o')!=count(t.begin(),t.end(),'o')); if(n==1 && !ok){ if(s=="oxx" && !(t=="oxx" || t=="xox")) ok=true; if(s=="xox" && !(t=="oxx" || t=="xxo")) ok=true; if(s=="xxo" && !(t=="xox" || t=="xxo")) ok=true; if(s=="xoo" && !(t=="xoo" || t=="oxo")) ok=true; if(s=="oxo" && !(t=="xoo" || t=="oox")) ok=true; if(s=="oox" && !(t=="oxo" || t=="oox")) ok=true; } } puts(ok?"SUCCESS":"FAILURE"); return 0; }