結果
問題 |
No.116 門松列(1)
|
ユーザー |
![]() |
提出日時 | 2016-02-19 23:29:22 |
言語 | D (dmd 2.109.1) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 362 bytes |
コンパイル時間 | 827 ms |
コンパイル使用メモリ | 103,680 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-12 02:57:36 |
合計ジャッジ時間 | 1,845 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 21 |
ソースコード
import std.stdio, std.conv, std.string, std.range, std.math, std.algorithm; void main() { auto N = readln.strip.to!int; auto A = readln.split.to!(int[]); iota(2, A.length) .count!(i=>A[i-2]<A[i-1]&&A[i-1]>A[i]&&A[i-2]!=A[i] ||A[i-2]>A[i-1]&&A[i-1]<A[i]&&A[i-2]!=A[i]) .writeln; }