結果
| 問題 |
No.1263 ご注文は数学ですか?
|
| コンテスト | |
| ユーザー |
gew1fw
|
| 提出日時 | 2025-06-12 21:04:28 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 353 bytes |
| コンパイル時間 | 373 ms |
| コンパイル使用メモリ | 82,176 KB |
| 実行使用メモリ | 51,712 KB |
| 最終ジャッジ日時 | 2025-06-12 21:05:50 |
| 合計ジャッジ時間 | 1,055 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 1 WA * 6 |
ソースコード
x = int(input())
mod = 10**9 + 7
# Precompute factorial mod mod
fact = 1
for i in range(2, x + 1):
fact = (fact * i) % mod
# The result is (-1) * (x! // 2)
# Since we are working modulo mod, division by 2 is multiplication by the modular inverse of 2
inv2 = pow(2, mod - 2, mod)
result = (-fact) % mod
result = (result * inv2) % mod
print(result)
gew1fw