結果

問題 No.116 門松列(1)
コンテスト
ユーザー kou_kkk
提出日時 2024-02-26 10:08:18
言語 Nim
(2.2.10 + ACL)
コンパイル:
nim --nimcache=~ --hints:off -o:a.out -d:release cpp _filename_
実行:
./a.out
結果
AC  
実行時間 1 ms / 5,000 ms
+ 370µs
コード長 303 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 3,542 ms
コンパイル使用メモリ 70,028 KB
実行使用メモリ 6,272 KB
最終ジャッジ日時 2026-09-06 00:55:06
合計ジャッジ時間 5,341 ms
ジャッジサーバーID
(参考情報)
judge2_1 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 21
権限があれば一括ダウンロードができます
コンパイルメッセージ
/home/judge/data/code/Main.nim(13, 10) Warning: type 'int' is too big to be a `set` element, assuming a range of 0..65535, explicitly write this range to get rid of warning [AboveMaxSizeSet]

ソースコード

diff #
raw source code

import sequtils, strutils

let
  n = parseInt readLine stdin
  a = stdin.readLine.split.map parseInt
var
  cnt = 0

for i in 2..<n:
  let
    max = max a[i.pred(2)..i]
    min = min a[i.pred(2)..i]
    mm = {max, min}
    
  if a[i] notin mm:
    inc cnt
  if a[i.pred 2] notin mm:
    inc cnt

echo cnt
0