結果

問題 No.197 手品
ユーザー izryt(趣味)izryt(趣味)
提出日時 2016-01-19 04:33:08
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 476 bytes
コンパイル時間 1,945 ms
コンパイル使用メモリ 153,652 KB
実行使用メモリ 4,508 KB
最終ジャッジ日時 2023-09-09 20:44:02
合計ジャッジ時間 3,327 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;

map<string, bool> m[5];
string S;
int N;

void rec(string s, int i)
{
    if (i == min(N, 5)) return;

    swap(s[0], s[1]);
    m[i][s] = true;
    rec(s, i + 1);
    swap(s[0], s[1]);

    swap(s[1], s[2]);
    m[i][s] = true;
    rec(s, i + 1);
    swap(s[1], s[2]);
}

int main()
{
    cin >> S;
    m[0][S] = true;
    cin >> N;
    rec(S, 0);
    cin >> S;

    cout << (m[min(N,3)][S] ? "FAILURE" : "SUCCESS") << endl;
}
0