結果
| 問題 | 
                            No.233 めぐるはめぐる (3)
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2019-01-26 19:58:06 | 
| 言語 | Nim  (2.2.0)  | 
                    
| 結果 | 
                             
                                CE
                                 
                             
                            
                            (最新)
                                AC
                                 
                             
                            (最初)
                            
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 854 bytes | 
| コンパイル時間 | 552 ms | 
| コンパイル使用メモリ | 50,944 KB | 
| 最終ジャッジ日時 | 2024-11-14 20:48:13 | 
| 合計ジャッジ時間 | 2,101 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge2 / judge5 | 
(要ログイン)
コンパイルエラー時のメッセージ・ソースコードは、提出者また管理者しか表示できないようにしております。(リジャッジ後のコンパイルエラーは公開されます)
ただし、clay言語の場合は開発者のデバッグのため、公開されます。
            
            
            
            
            ただし、clay言語の場合は開発者のデバッグのため、公開されます。
コンパイルメッセージ
/home/judge/data/code/Main.nim(2, 21) Error: cannot open file: queues
ソースコード
import sequtils,algorithm,math,tables
import sets,intsets,queues,heapqueue,bitops,strutils
template times*(n:int,body) = (for _ in 0..<n: body)
template `max=`*(x,y) = x = max(x,y)
template `min=`*(x,y) = x = min(x,y)
proc getchar_unlocked():char {. importc:"getchar_unlocked",header: "<stdio.h>" .}
proc scan(): int =
  while true:
    let k = getchar_unlocked()
    if k < '0': break
    result = 10 * result + k.ord - '0'.ord
let n = scan()
var used = initSet[string]()
n.times: used.incl stdin.readLine()
var S = "inabameguru".sorted(cmp).join("")
while true:
  var ok = true
  const consonant = ['n','b','m','g','r']
  for i in 1..<S.len:
    if S[i] in consonant and S[i-1] in consonant:
      ok = false
      break
  if ok and S[^1] in consonant : ok = false
  if ok and S notin used:
    quit S, 0
  if not S.nextPermutation(): break
echo "NO"