結果
問題 | No.233 めぐるはめぐる (3) |
ユーザー | chocorusk |
提出日時 | 2018-10-19 14:17:51 |
言語 | C++11 (gcc 11.4.0) |
結果 |
AC
|
実行時間 | 161 ms / 1,000 ms |
コード長 | 1,070 bytes |
コンパイル時間 | 902 ms |
コンパイル使用メモリ | 103,132 KB |
実行使用メモリ | 12,640 KB |
最終ジャッジ日時 | 2024-04-28 16:59:13 |
合計ジャッジ時間 | 5,551 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 134 ms
12,516 KB |
testcase_01 | AC | 123 ms
12,636 KB |
testcase_02 | AC | 78 ms
12,516 KB |
testcase_03 | AC | 114 ms
12,512 KB |
testcase_04 | AC | 136 ms
12,636 KB |
testcase_05 | AC | 136 ms
12,640 KB |
testcase_06 | AC | 140 ms
12,516 KB |
testcase_07 | AC | 161 ms
12,512 KB |
testcase_08 | AC | 130 ms
12,512 KB |
testcase_09 | AC | 47 ms
12,584 KB |
testcase_10 | AC | 52 ms
12,640 KB |
testcase_11 | AC | 54 ms
12,640 KB |
testcase_12 | AC | 110 ms
12,512 KB |
testcase_13 | AC | 159 ms
12,640 KB |
ソースコード
#include <cstdio> #include <cstring> #include <string> #include <iostream> #include <cmath> #include <bitset> #include <vector> #include <map> #include <set> #include <queue> #include <deque> #include <algorithm> #include <unordered_map> #include <unordered_set> #include <random> using namespace std; typedef long long int ll; typedef pair<int, int> P; int main() { unordered_set<string> st; string s="nbmgr"; for(int i=0; i<120; i++){ string t="iaaeuu"; for(int j=0; j<180; j++){ for(int k=0; k<6; k++){ bool siin[11]={}; for(int l=0; l<5; l++){ if(l>=k) siin[2*l+1]=1; else siin[2*l]=1; } int is=0, it=0; string u; for(int l=0; l<11; l++){ if(siin[l]){ u+=s[is]; is++; }else{ u+=t[it]; it++; } } st.insert(u); } next_permutation(t.begin(), t.end()); } next_permutation(s.begin(), s.end()); } int n; cin>>n; for(int i=0; i<n; i++){ string s0; cin>>s0; st.erase(s0); } if(st.empty()){ cout<<"NO"<<endl; }else{ cout<<*(st.begin())<<endl; } return 0; }