結果

問題 No.21 平均の差
ユーザー はむ吉🐹はむ吉🐹
提出日時 2016-11-19 20:40:44
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 221 ms / 5,000 ms
コード長 593 bytes
コンパイル時間 256 ms
コンパイル使用メモリ 87,268 KB
実行使用メモリ 86,660 KB
最終ジャッジ日時 2023-08-18 03:44:42
合計ジャッジ時間 3,847 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 221 ms
86,040 KB
testcase_01 AC 217 ms
86,384 KB
testcase_02 AC 215 ms
86,036 KB
testcase_03 AC 215 ms
86,212 KB
testcase_04 AC 216 ms
86,512 KB
testcase_05 AC 218 ms
86,424 KB
testcase_06 AC 217 ms
86,480 KB
testcase_07 AC 216 ms
86,424 KB
testcase_08 AC 215 ms
86,412 KB
testcase_09 AC 216 ms
86,660 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/env pypy3

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