結果
| 問題 | No.864 四方演算 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-05-19 01:42:07 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 655 bytes |
| 記録 | |
| コンパイル時間 | 320 ms |
| コンパイル使用メモリ | 12,800 KB |
| 実行使用メモリ | 10,752 KB |
| 最終ジャッジ日時 | 2024-10-01 22:24:28 |
| 合計ジャッジ時間 | 3,942 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 25 WA * 2 |
ソースコード
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)
def make_divisors(n):
divisors = []
for i in range(1, int(n ** 0.5) + 1):
if n % i == 0:
divisors.append(i)
if i != n // i:
divisors.append(n // i)
# divisors.sort()
return divisors
n = int(readline())
k = int(readline())
k = make_divisors(k)
ans = 0
for x, y in zip(k[::2], k[1::2]):
xx = x - 1 if n >= x else 2 * n + 1 - x
yy = y - 1 if n >= y else 2 * n + 1 - y
if xx >= 0 and yy >= 0:
ans += xx * yy * 2
print(ans)