結果

問題 No.360 増加門松列
ユーザー むらため
提出日時 2019-01-25 03:31:31
言語 Nim
(2.2.0)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 533 bytes
コンパイル時間 2,619 ms
コンパイル使用メモリ 61,732 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-07-01 10:42:34
合計ジャッジ時間 3,538 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 14 WA * 8
権限があれば一括ダウンロードができます

ソースコード

diff #

import sequtils,algorithm
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

var D = newSeqWith(7,scan()).sorted(cmp)
proc check(): bool =
  for i in 2..<7:
    if D[i] == D[i-1] : return false
    if D[i-1] == D[i-2] : return false
    if D[i-2] >= D[i] : return false
  return true
while true:
  if check():
    quit "YES",0
  if not D.nextPermutation(): break
echo "NO"
0