結果
| 問題 |
No.21 平均の差
|
| コンテスト | |
| ユーザー |
はむ吉🐹
|
| 提出日時 | 2016-11-19 20:40:44 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 77 ms / 5,000 ms |
| コード長 | 593 bytes |
| コンパイル時間 | 151 ms |
| コンパイル使用メモリ | 82,128 KB |
| 実行使用メモリ | 75,940 KB |
| 最終ジャッジ日時 | 2024-11-27 06:16:14 |
| 合計ジャッジ時間 | 1,932 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 10 |
ソースコード
#!/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()
はむ吉🐹