結果

問題 No.864 四方演算
ユーザー akitsugu777akitsugu777
提出日時 2019-08-27 16:32:07
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 520 bytes
コンパイル時間 193 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 11,008 KB
最終ジャッジ日時 2024-04-27 17:20:50
合計ジャッジ時間 4,319 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 27 ms
10,880 KB
testcase_01 AC 171 ms
10,752 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 158 ms
10,880 KB
testcase_07 AC 139 ms
10,752 KB
testcase_08 AC 131 ms
10,752 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 AC 25 ms
10,752 KB
testcase_28 AC 26 ms
10,880 KB
testcase_29 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
k = int(input())

kn = []
for i in range(1, int(k**0.5)+1):
    if k % i == 0:
        if i != 1 and k//i <= 2*n:
            kn.append([i, k//i])

z = 0
for i, j in kn:
    if i == j:
        print(1)
        break
    else:
        x = 0
        y = 0
        if 2 <= i <= n+1:
            x = i - 1
        elif n+2 <= i <= 2*n:
            x = 2*n + 1 - i
        if 2 <= j <= n+1:
            y = j - 1
        elif n+2 <= j <= 2*n:
            y = 2*n + 1 - j
        z += x * y
        print(z*2)
0