結果
問題 | No.197 手品 |
ユーザー |
![]() |
提出日時 | 2016-01-08 22:56:01 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 717 bytes |
コンパイル時間 | 465 ms |
コンパイル使用メモリ | 55,580 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-20 03:44:54 |
合計ジャッジ時間 | 1,474 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 43 |
ソースコード
#include<iostream> using namespace std; int main(void) { int n, i,marua=0,marub=0,batu=0; char sa[3], sb[3]; cin >> sa >> n >> sb; for (i = 0; i < 3; i++) { if (sa[i] == 'o')marua++; if (sb[i] == 'o')marub++; } if (marua != marub) { cout << "SUCCESS" << endl; return 0; } if (n > 1||marua==3||marub==0) { cout << "FAILURE" << endl; } else { if (n == 0 && sa[0] == sb[0] && sa[1] == sb[1])//n0で一緒 cout << "FAILURE" << endl; else if ((n == 1 && sa[0] == sa[2] && sa[1] != sb[1]) || (n == 1 && sa[0] != sa[2] &&( (sa[1] != sb[1])||(sa[0]==sb[0]&&sa[1]==sb[1]))))//n1であり得る組み合わせ cout << "FAILURE" << endl; else cout << "SUCCESS" << endl; } return 0; }