結果
問題 | No.2269 eN!の整数部分の下1桁 |
ユーザー |
|
提出日時 | 2023-04-15 00:04:28 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 902 ms / 2,000 ms |
コード長 | 331 bytes |
コンパイル時間 | 99 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 10,752 KB |
最終ジャッジ日時 | 2024-10-10 15:02:41 |
合計ジャッジ時間 | 6,238 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 23 |
ソースコード
t = int(input()) # e = 1/1 + 1/2! + 1/3! + ... # e(N!) = N!/1! + N!/2! + N!/3! + ... + N + 1 + (小さい数) for _ in range(t): n = int(input()) if n == 0: print(2) continue ans = 0 tmp = 1 for i in range(min(n+1, 5)): ans += tmp ans %= 10 tmp *= n - i print(ans)