結果
問題 | No.233 めぐるはめぐる (3) |
ユーザー | koyopro |
提出日時 | 2015-10-18 00:12:39 |
言語 | C++11 (gcc 11.4.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,043 bytes |
コンパイル時間 | 3,202 ms |
コンパイル使用メモリ | 157,904 KB |
実行使用メモリ | 22,380 KB |
最終ジャッジ日時 | 2023-09-28 21:55:02 |
合計ジャッジ時間 | 7,608 ms |
ジャッジサーバーID (参考情報) |
judge11 / judge12 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 141 ms
16,684 KB |
testcase_01 | AC | 82 ms
11,840 KB |
testcase_02 | AC | 36 ms
7,464 KB |
testcase_03 | AC | 94 ms
12,836 KB |
testcase_04 | AC | 212 ms
22,272 KB |
testcase_05 | WA | - |
testcase_06 | WA | - |
testcase_07 | AC | 214 ms
22,316 KB |
testcase_08 | AC | 213 ms
22,260 KB |
testcase_09 | AC | 1 ms
4,380 KB |
testcase_10 | AC | 1 ms
4,376 KB |
testcase_11 | AC | 1 ms
4,376 KB |
testcase_12 | AC | 80 ms
11,952 KB |
testcase_13 | AC | 145 ms
16,900 KB |
ソースコード
#include "bits/stdc++.h" using namespace std; #define REP(i, n) for(int i=0; i<(n); i++) #define ALL(a) (a).begin(),(a).end() #define CONTAIN(a, b) find(ALL(a), (b)) != (a).end() int N,T; map<string, bool> check; vector<string> S; map<string, bool> has; signed main() { cin >> N; S.resize(N); REP(i,N) { cin >> S[i]; has[S[i]] = true; } string vowels = "iaaeuu"; string consonants = "tnbmgr"; string t = ""; bool ok = false; do { do { t = ""; REP(i,6) { char c = consonants[i]; if (c != 't') t += c; t += vowels[i]; } if (check[t]) continue; if (!has[t]) { ok = true; break; } check[t] = true; }while(next_permutation(ALL(consonants))); if (ok) break; }while(next_permutation(ALL(vowels))); if (ok) { cout << t << endl; } else { cout << "NO" << endl; } return 0; }