結果
問題 |
No.197 手品
|
ユーザー |
![]() |
提出日時 | 2015-04-28 23:39:17 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,223 bytes |
コンパイル時間 | 561 ms |
コンパイル使用メモリ | 72,244 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-27 07:16:26 |
合計ジャッジ時間 | 1,688 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 WA * 2 |
other | AC * 4 WA * 39 |
ソースコード
#include <iostream> #include <cstdio> #include <algorithm> #include <cassert> #include <vector> #include <string> #include <cmath> #include <map> #include <sstream> #include <cstdio> using namespace std; const int MAX= 10000100; #define loop(i,a,b) for(int i = a ; i < b ; i ++) #define rep(i,a) loop(i,0,a) #define all(a) (a).begin(),(a).end() #define ll long long int #define gcd(a,b) __gcd(a,b) #define pb(a) push_back(a) int GCD(int a, int b) {if(!b) return a; return gcd(b, a%b);} int lcm(int a, int b) {return a*b / gcd(a, b);} int main(void){ string sb,sf; int n; cin>>sb>>n>>sf; bool ans = false; if(sb[0] == 'o' && sb[1] == 'x' && sb[2] == 'x' && sf[0] == 'x' && sf[1] == 'x' && sf[2] == 'o' ){ if(n <= 2){ ans = true; } } if(sb[0] == 'x' && sb[1] == 'x' && sb[2] == 'o' && sf[0] == 'o' && sf[1] == 'x' && sf[2] == 'x' ){ if(n <= 2){ ans = true; } } int sfnum = 0; int sbnum = 0; rep(i,sb.size()){ if(sb[i] == 'o')sbnum++; } rep(i,sf.size()){ if(sf[i] == 'o')sfnum++; } //cout<<sfnum<<" " <<sbnum<<endl; if(sfnum != sbnum){ //cout<<"diff"<<endl; ans = true; } cout<<(ans?"SUCCESS":"FALURE")<<endl; }