結果

問題 No.197 手品
ユーザー h_noson
提出日時 2016-02-18 15:21:27
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 748 bytes
コンパイル時間 881 ms
コンパイル使用メモリ 60,372 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-06-27 13:17:50
合計ジャッジ時間 1,680 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 37 WA * 6
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

#define RREP(i,s,e) for (int i = e-1; i >= s; i--)
#define rrep(i,n) RREP(i,0,n)
#define REP(i,s,e) for (int i = s; i < e; i++)
#define rep(i,n) REP(i,0,n)

int main() {
    string s1,s2;
    long long n;
    int cnt1, cnt2;
    cin >> s1 >> n >> s2;

    cnt1 = cnt2 = 0;
    rep (i,3) {
        cnt1 += s1[i] == 'o';
        cnt2 += s2[i] == 'o';
    }
    if (cnt1 != cnt2 || n == 0 && s1 != s2)
        cout << "SUCCESS" << endl;
    else if (n >= 2 || s1 == s2)
        cout << "FAILURE" << endl;
    else if (s1[1]+s1[0]+s1[2]+"" == s2 || s1[0]+s1[2]+s1[1]+"" == s2)
        cout << "FAILURE" << endl;
    else
        cout << "SUCCESS" << endl;
    return 0;
}
0