結果
| 問題 | 
                            No.197 手品
                             | 
                    
| コンテスト | |
| ユーザー | 
                             m1025o1184t
                         | 
                    
| 提出日時 | 2019-12-30 01:03:42 | 
| 言語 | C++14  (gcc 13.3.0 + boost 1.87.0)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 635 bytes | 
| コンパイル時間 | 1,565 ms | 
| コンパイル使用メモリ | 167,728 KB | 
| 実行使用メモリ | 5,248 KB | 
| 最終ジャッジ日時 | 2024-11-06 23:01:11 | 
| 合計ジャッジ時間 | 3,174 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge3 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 4 | 
| other | AC * 40 WA * 3 | 
ソースコード
#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';
	}
	n++;
	do {
		if (S == T) {
			dunk("FAILURE");
			return 0;
		}
		n--;
		if (n == 0) break;
	} while (next_permutation(all(S)));
	dunk("SUCCESS");
	return 0;
}
            
            
            
        
            
m1025o1184t