結果
問題 | No.275 中央値を求めよ |
ユーザー |
|
提出日時 | 2019-09-14 00:19:57 |
言語 | Nim (2.2.0) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 258 bytes |
コンパイル時間 | 3,370 ms |
コンパイル使用メモリ | 66,056 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-04 10:41:15 |
合計ジャッジ時間 | 4,413 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 38 |
ソースコード
import algorithm, sequtils, strutilsvarn: int = stdin.readline.parseInta: seq[int] = stdin.readline.split.map(parseInt)ans: floatsort(a)if n mod 2 == 0:ans = (a[n div 2] + a[n div 2 - 1]) / 2else:ans = a[n div 2].toFloatecho ans