結果

問題 No.21 平均の差
コンテスト
ユーザー はむ吉🐹
提出日時 2016-10-16 16:26:50
言語 Python3
(3.15.0 + numpy 2.5.4 + scipy 1.18.1 + ACL)
コンパイル:
python3 -mpy_compile _filename_
実行:
python3 _filename_
結果
AC  
実行時間 26 ms / 5,000 ms
+ 742µs
コード長 596 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 57 ms
コンパイル使用メモリ 15,232 KB
実行使用メモリ 13,056 KB
最終ジャッジ日時 2026-09-28 03:25:32
合計ジャッジ時間 1,885 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 10
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#!/usr/bin/env python3

import sqlite3


def main():
    connection = sqlite3.connect(":memory:")
    cursor = connection.cursor()
    cursor.execute("CREATE TABLE sequence(item INTEGER)")
    n = int(input())
    _ = input()
    xs = ((int(input()), ) for _ in range(n))
    cursor.executemany("INSERT INTO sequence VALUES (?)", xs)
    connection.commit()
    max_x = cursor.execute("SELECT max(item) FROM sequence").fetchone()[0]
    min_x = cursor.execute("SELECT min(item) FROM sequence").fetchone()[0]
    print(max_x - min_x)
    connection.close()


if __name__ == '__main__':
    main()
0