結果

問題 No.360 増加門松列
ユーザー むらためむらため
提出日時 2019-01-25 03:31:31
言語 Nim
(2.0.2)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 533 bytes
コンパイル時間 1,983 ms
コンパイル使用メモリ 66,988 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-14 02:43:18
合計ジャッジ時間 3,064 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 AC 1 ms
4,376 KB
testcase_05 AC 1 ms
4,376 KB
testcase_06 AC 1 ms
4,380 KB
testcase_07 AC 1 ms
4,380 KB
testcase_08 AC 1 ms
4,376 KB
testcase_09 AC 2 ms
4,380 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 1 ms
4,376 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 1 ms
4,376 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 2 ms
4,380 KB
testcase_19 AC 1 ms
4,376 KB
testcase_20 AC 2 ms
4,376 KB
testcase_21 AC 2 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

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