結果

問題 No.197 手品
ユーザー e-mon
提出日時 2015-04-30 01:29:12
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 817 bytes
コンパイル時間 1,324 ms
コンパイル使用メモリ 159,520 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-06-27 09:00:25
合計ジャッジ時間 2,501 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 41 WA * 2
権限があれば一括ダウンロードができます

ソースコード

diff #

#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{
        printf("FAILURE\n");
    }

    return 0;
}
0