結果

問題 No.197 手品
ユーザー memmemmi
提出日時 2018-09-26 14:05:27
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 1,143 bytes
コンパイル時間 1,210 ms
コンパイル使用メモリ 112,200 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-10-10 10:58:35
合計ジャッジ時間 2,472 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 35 WA * 8
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
#include <iomanip>
#include <array>
#include <numeric>
#include <regex>
#include <bitset>
#include <deque>

using namespace std;
typedef long long ll;
typedef pair<int, int> p_ii;

const int INF = 1e9;
const double PI = acos(-1.0);
const ll MOD = 1e9 + 7;



int main() {
    string s,t;
    int n;
    cin>>s>>n>>t;
    int r1, r2, x1, x2;
    r1=r2=x1=x2=0;
    for (int i = 0; i < 3; i++) {
        if(s[i]=='o')r1++;
        else x1++;
        if(t[i]=='o')r2++;
        else x2++;
    }
    if(r1!=r2||x1!=x2){
        cout<<"SUCCESS"<<endl;
        return 0;
    }
    bool flg=false;
    if(n==0) flg|=(s!=t);
    else if(n==1){
        string p1=s, p2=s;
        swap(p1[0],p1[1]);
        swap(p2[1],p2[2]);
        flg|=(p1!=t||p2!=t);
    }

    cout<<((flg)?"SUCCESS":"FAILURE")<<endl;

    return 0;
}
0