結果
問題 | No.197 手品 |
ユーザー |
![]() |
提出日時 | 2020-01-11 22:52:27 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 752 bytes |
コンパイル時間 | 1,645 ms |
コンパイル使用メモリ | 178,312 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-11-26 07:46:23 |
合計ジャッジ時間 | 2,898 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 41 WA * 2 |
ソースコード
#include<bits/stdc++.h> using namespace std; #ifdef LOCAL_DEBUG #include "LOCAL_DEBUG.hpp" #endif #define int long long const int INF = 1LL << 60; signed main(){ string s, t; int n; cin >> s >> n >> t; map<string, int> mp; for(int i = 0; i < 1 << 3; i++){ string str; for(int j = 0; j < 3; j++){ if(i >> j & 1) str += 'o'; else str += 'x'; } mp[str] = INF; } function< void(string,int) > rec = [&](string s, int k){ if(k > 0) mp[s] = min(mp[s], k); if(k > 6) return; swap(s[0], s[1]); rec(s, k+1); swap(s[0], s[1]); swap(s[1], s[2]); rec(s, k+1); }; rec(s, 0); if(mp[t] <= n){ cout << "FAILURE" << endl; }else{ cout << "SUCCESS" << endl; } return 0; }