結果
| 問題 |
No.233 めぐるはめぐる (3)
|
| コンテスト | |
| ユーザー |
chocorusk
|
| 提出日時 | 2018-10-19 14:17:51 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 118 ms / 1,000 ms |
| コード長 | 1,070 bytes |
| コンパイル時間 | 944 ms |
| コンパイル使用メモリ | 101,520 KB |
| 実行使用メモリ | 12,700 KB |
| 最終ジャッジ日時 | 2024-11-17 10:44:43 |
| 合計ジャッジ時間 | 4,933 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 11 |
ソースコード
#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;
}
chocorusk