結果

問題 No.1366 交換門松列・梅
ユーザー kou_kkk
提出日時 2024-03-27 01:55:03
言語 Nim
(2.2.0)
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 462 bytes
コンパイル時間 4,069 ms
コンパイル使用メモリ 68,060 KB
実行使用メモリ 7,844 KB
最終ジャッジ日時 2025-06-20 11:19:05
合計ジャッジ時間 4,706 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 13
権限があれば一括ダウンロードができます

ソースコード

diff #

import sequtils, strutils


proc isK(xs: seq[int]): bool =
  result = true
  if xs.len < 3: return false
  let l = xs[0]; let r = xs[2]
  if l == r: return false
  if l == xs.max and r == xs.min: return false
  if l == xs.min and r == xs.max: return false


let
  a, b = stdin.readLine.split.map parseInt

for i in 0..2:
  for j in 0..2:
    var
      x = a
      y = b
    swap(x[i], y[j])
    
    if isK(x) and isK(y):
      echo "Yes"
      quit()

echo "No"
0