提出 #3635675


ソースコード 拡げる

n,k=map(int,input().split())
c=0
s = k if k%2==1 else k//2
for i in range(s,n+1,s):
    s2 = k if i%k==0 else s
    n2 = (n-s2)//k+1
    c+=n2**2
print(c)

提出情報

提出日時
問題 C - Triangular Relationship
ユーザ sei1tani
言語 Python (3.4.3)
得点 300
コード長 161 Byte
結果 AC
実行時間 150 ms
メモリ 2940 KiB

ジャッジ結果

セット名 Sample All
得点 / 配点 0 / 0 300 / 300
結果
AC × 4
AC × 18
セット名 テストケース
Sample s1.txt, s2.txt, s3.txt, s4.txt
All 01.txt, 02.txt, 03.txt, 04.txt, 05.txt, 06.txt, 07.txt, 08.txt, 09.txt, 10.txt, 11.txt, 12.txt, 13.txt, 14.txt, s1.txt, s2.txt, s3.txt, s4.txt
ケース名 結果 実行時間 メモリ
01.txt AC 150 ms 2940 KiB
02.txt AC 148 ms 2940 KiB
03.txt AC 63 ms 2940 KiB
04.txt AC 19 ms 2940 KiB
05.txt AC 19 ms 2940 KiB
06.txt AC 19 ms 2940 KiB
07.txt AC 19 ms 2940 KiB
08.txt AC 18 ms 2940 KiB
09.txt AC 18 ms 2940 KiB
10.txt AC 36 ms 2940 KiB
11.txt AC 21 ms 2940 KiB
12.txt AC 29 ms 2940 KiB
13.txt AC 18 ms 2940 KiB
14.txt AC 19 ms 2940 KiB
s1.txt AC 19 ms 2940 KiB
s2.txt AC 19 ms 2940 KiB
s3.txt AC 19 ms 2940 KiB
s4.txt AC 19 ms 2940 KiB