結果

問題 No.233 めぐるはめぐる (3)
ユーザー kotatsugame
提出日時 2020-03-02 22:18:06
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 169 ms / 1,000 ms
コード長 596 bytes
コンパイル時間 794 ms
コンパイル使用メモリ 84,872 KB
実行使用メモリ 12,032 KB
最終ジャッジ日時 2024-10-13 21:19:40
合計ジャッジ時間 4,508 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 11
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp:6:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    6 | main()
      | ^~~~

ソースコード

diff #

#include<iostream>
#include<set>
#include<vector>
#include<algorithm>
using namespace std;
main()
{
	set<string>S;
	vector<char>A={'a','a','e','i','u','u'};
	vector<char>B={'b','g','m','n','r'};
	do{
		do{
			string now="";
			for(int i=0;i<5;i++)now+=B[i],now+=A[i];
			for(int i=0;i<5;i++)
			{
				S.insert(now.substr(0,i*2)+A[5]+now.substr(i*2));
			}
		}while(next_permutation(B.begin(),B.end()));
	}while(next_permutation(A.begin(),A.end()));
	int N;
	cin>>N;
	for(;N--;)
	{
		string s;
		cin>>s;
		S.erase(s);
	}
	set<string>::iterator it=S.begin();
	cout<<(it==S.end()?"NO":*it)<<endl;
}
0