結果
問題 | No.197 手品 |
ユーザー |
![]() |
提出日時 | 2016-10-21 00:46:43 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 670 bytes |
コンパイル時間 | 469 ms |
コンパイル使用メモリ | 62,100 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-27 13:35:46 |
合計ジャッジ時間 | 1,679 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 39 WA * 4 |
ソースコード
#include <iostream> #include <math.h> #include <string> #include <algorithm> using namespace std; int main(){ string sb; string sa; long long n; int cnta = 0; int cntb = 0; cin >>sb>> n>>sa; for (int i = 0; i < 3; i++){ if (sb[i] == 'o'){ cntb++; } if (sa[i] == 'o'){ cnta++; } } if (cntb != cnta){ cout << "SUCCESS" << endl; }else if (n >= 2){ cout << "FAILURE" << endl; } else if (n == 0){ if (sb == sa){ cout << "FAILURE" << endl; } else{ cout << "SUCCESS" << endl; } } else{ if (sb[1] == sa[1] && (cnta == 1 || cnta == 2)){ cout << "SUCCESS" << endl; } else{ cout << "FAILURE" << endl; } } return 0; }