結果

問題 No.197 手品
ユーザー tetsuzuki1115
提出日時 2017-10-28 20:21:58
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 930 bytes
コンパイル時間 570 ms
コンパイル使用メモリ 79,140 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-06-27 13:51:12
合計ジャッジ時間 1,772 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3 WA * 1
other AC * 41 WA * 2
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <string>
#include <cstring>
#include <math.h>
#include <cmath>
#include <limits.h>
#include <map>
#include <set>
#include <queue>
#include <algorithm>
#include <functional>
#include <stdio.h>
using namespace std;

long long MOD = 1000000007;

int main() {
    
    string SB,SA;
    long long N;
    cin >> SB >> N >> SA;
    
    int a = 0, b = 0;
    for ( int i = 0; i < 3; i++ ) {
        if ( SB[i] == 'o' ) { b++; }
        if ( SA[i] == 'o' ) { a++; }
    }
    if ( a != b ) { cout << "SUCCESS" << endl; }
    else if ( a == 3 || a == 0 ) { cout << "FAILURE" << endl; }
    else {
        bool B = SB[0] == SB[2];
        bool A = SA[0] == SA[2];
        if ( !B && !A ) { cout << "FAILURE" << endl; }
        else if ( B != A ) { cout << ( N ? "FAILURE" : "SUCCESS" ) << endl; }
        else { cout << ( N == 1 ? "SUCCESS" : "FAILURE" ) << endl; }
    }
    
    return 0;
}
0