結果

問題 No.197 手品
ユーザー h_noson
提出日時 2016-02-18 15:31:47
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 771 bytes
コンパイル時間 688 ms
コンパイル使用メモリ 62,336 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-07-20 03:45:55
合計ジャッジ時間 1,814 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 43
権限があれば一括ダウンロードができます

ソースコード

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 || n == 0 && s1 == s2)
        cout << "FAILURE" << endl;
    else if (string{}+s1[1]+s1[0]+s1[2] == s2 || string{}+s1[0]+s1[2]+s1[1] == s2)
        cout << "FAILURE" << endl;
    else
        cout << "SUCCESS" << endl;
    return 0;
}
0