結果

問題 No.233 めぐるはめぐる (3)
ユーザー kotatsugamekotatsugame
提出日時 2020-03-02 22:18:06
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 183 ms / 1,000 ms
コード長 596 bytes
コンパイル時間 937 ms
コンパイル使用メモリ 84,580 KB
実行使用メモリ 12,032 KB
最終ジャッジ日時 2024-04-21 22:53:05
合計ジャッジ時間 5,470 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 176 ms
11,904 KB
testcase_01 AC 140 ms
12,032 KB
testcase_02 AC 95 ms
12,032 KB
testcase_03 AC 151 ms
11,904 KB
testcase_04 AC 183 ms
12,032 KB
testcase_05 AC 179 ms
11,904 KB
testcase_06 AC 181 ms
12,032 KB
testcase_07 AC 176 ms
12,032 KB
testcase_08 AC 183 ms
12,032 KB
testcase_09 AC 46 ms
11,904 KB
testcase_10 AC 44 ms
12,032 KB
testcase_11 AC 45 ms
11,904 KB
testcase_12 AC 138 ms
12,032 KB
testcase_13 AC 180 ms
12,032 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
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