結果
| 問題 |
No.197 手品
|
| コンテスト | |
| ユーザー |
m1025o1184t
|
| 提出日時 | 2019-12-30 01:09:30 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 721 bytes |
| コンパイル時間 | 1,737 ms |
| コンパイル使用メモリ | 170,936 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-11-06 23:08:47 |
| 合計ジャッジ時間 | 3,178 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 37 WA * 6 |
ソースコード
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);++i)
#define all(a) (a).begin(),(a).end()
#define dunk(a) cout << (a) << endl
using namespace std;
typedef long long ll;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
string S, T;
ll n;
cin >> S >> n >> T;
if (S[0] == 'x' && S[2] == 'o') {
reverse(all(S));
reverse(all(T));
}
rep(i, 3) {
if (S[i] == 'o') S[i] = 'A';
else S[i] = 'B';
if (T[i] == 'o') T[i] = 'A';
else T[i] = 'B';
}
if (n >= 6) sort(all(S));
if (n == 1 && S == T) {
dunk("SUCCESS");
return 0;
}
n++;
do {
if (S == T) {
dunk("FAILURE");
return 0;
}
n--;
if (n == 0) break;
} while (next_permutation(all(S)));
dunk("SUCCESS");
return 0;
}
m1025o1184t