結果
問題 | No.1707 Simple Range Reverse Problem |
ユーザー |
![]() |
提出日時 | 2023-09-03 02:32:04 |
言語 | Nim (2.2.0) |
結果 |
RE
(最新)
AC
(最初)
|
実行時間 | - |
コード長 | 497 bytes |
コンパイル時間 | 5,711 ms |
コンパイル使用メモリ | 70,272 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-12 07:19:42 |
合計ジャッジ時間 | 5,907 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 8 RE * 10 |
ソースコード
import sequtils, strutils, tableslet t = parseInt readLine stdinproc fn(): bool =letn = parseInt readLine stdina = stdin.readLine.split.map parseIntcntT = a.toCountTableif a[0] != 1: return falseif a[^1] != n: return falseif cntT.largest.val != 2: return falseif cntT.smallest.val != 2: return falsefor i in 1 .. a.high:let x = abs a[i] - a[pred i]if x notin {1, pred n}: return falsereturn truefor _ in 0 ..< t:echo if fn(): "Yes" else: "No"