結果
問題 | No.197 手品 |
ユーザー |
![]() |
提出日時 | 2015-04-30 01:47:36 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 954 bytes |
コンパイル時間 | 1,222 ms |
コンパイル使用メモリ | 160,392 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-06-27 09:05:27 |
合計ジャッジ時間 | 2,489 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 42 WA * 1 |
ソースコード
#include <bits/stdc++.h> using namespace std; typedef vector<int> vi; typedef pair<int, int> pii; typedef long long ll; #define FOR(i,a,b) for(int i=(a);i<(b);i++) #define REP(i,n) FOR(i,0,n) int main(){ // char Sbefore[3]; // char Safter[3]; string Sbefore; string Safter; int N=0; cin >> Sbefore ; cin >> N; cin >> Safter ; int fail_count=0; for(int i=0;i<3;i++){ if(Sbefore[i] != Safter[i]){ fail_count ++; } } if(count(Sbefore.begin(),Sbefore.end(),'o') != count(Safter.begin(),Safter.end(),'o')){ printf("SUCCESS\n"); }else if((N == 0 and fail_count > 0) or (N == 1 and Sbefore[0] != Safter[0] and Sbefore[2] != Safter[2])){ printf("SUCCESS\n"); }else if(N == 1 and Sbefore[0] == 'o' and Sbefore[1] == 'x' and Sbefore[2] == 'o' and fail_count == 0){ printf("SUCCESS\n"); }else{ printf("FAILURE\n"); } return 0; }