結果
問題 | No.197 手品 |
ユーザー |
![]() |
提出日時 | 2016-10-21 00:57:57 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 803 bytes |
コンパイル時間 | 654 ms |
コンパイル使用メモリ | 63,056 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-07-20 03:50:09 |
合計ジャッジ時間 | 2,236 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 43 |
ソースコード
#include <iostream> #include <math.h> #include <string> #include <algorithm> using namespace std; int main(){ string sb; string sa; int 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]){ if (sa == sb){ if (sa[0] == sa[2] && sa[0] != sa[1]){ cout << "SUCCESS" << endl; } else{ cout << "FAILURE" << endl; } } else{ cout << "SUCCESS" << endl; } } else{ cout << "FAILURE" << endl; } } return 0; }