結果

問題 No.197 手品
ユーザー maine_honzukimaine_honzuki
提出日時 2020-12-16 12:59:58
言語 C++17
(gcc 13.2.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 739 bytes
コンパイル時間 2,075 ms
コンパイル使用メモリ 202,280 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-20 09:20:49
合計ジャッジ時間 4,143 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 AC 2 ms
4,348 KB
testcase_05 AC 2 ms
4,348 KB
testcase_06 AC 2 ms
4,348 KB
testcase_07 AC 2 ms
4,348 KB
testcase_08 AC 2 ms
4,348 KB
testcase_09 AC 2 ms
4,348 KB
testcase_10 AC 2 ms
4,348 KB
testcase_11 AC 1 ms
4,348 KB
testcase_12 AC 2 ms
4,348 KB
testcase_13 AC 2 ms
4,348 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 2 ms
4,348 KB
testcase_24 AC 2 ms
4,348 KB
testcase_25 AC 2 ms
4,348 KB
testcase_26 AC 2 ms
4,348 KB
testcase_27 WA -
testcase_28 AC 2 ms
4,348 KB
testcase_29 WA -
testcase_30 AC 2 ms
4,348 KB
testcase_31 AC 1 ms
4,348 KB
testcase_32 AC 2 ms
4,348 KB
testcase_33 WA -
testcase_34 AC 2 ms
4,348 KB
testcase_35 AC 2 ms
4,348 KB
testcase_36 AC 1 ms
4,348 KB
testcase_37 WA -
testcase_38 AC 2 ms
4,348 KB
testcase_39 WA -
testcase_40 AC 2 ms
4,348 KB
testcase_41 WA -
testcase_42 WA -
testcase_43 AC 2 ms
4,348 KB
testcase_44 WA -
testcase_45 AC 2 ms
4,348 KB
testcase_46 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

int main() {
    string S_bef, S_aft;
    int N;
    cin >> S_bef >> N >> S_aft;

    bool flag = false;
    if (N == 0)
        flag = S_bef == S_aft;
    else {
        int cnt_bef = 0, cnt_aft = 0;
        int parity_bef = 0, parity_aft = 0;
        for (int i = 0; i < 3; i++) {
            cnt_bef += S_bef[i] == 'o';
            cnt_aft += S_aft[i] == 'o';
            parity_bef += (S_bef[i] == 'o') * (i + 1);
            parity_aft += (S_aft[i] == 'o') * (i + 1);
            if (cnt_bef == cnt_aft) {
                if (abs(parity_bef - parity_aft) % 2 == N % 2)
                    flag = true;
            }
        }
    }

    cout << (flag ? "FAILURE" : "SUCCESS") << endl;
}
0