結果

問題 No.2043 Ohuton and Makura
ユーザー mrngmrng
提出日時 2022-08-27 13:03:10
言語 PyPy3
(7.3.15)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 388 bytes
コンパイル時間 258 ms
コンパイル使用メモリ 82,432 KB
実行使用メモリ 273,280 KB
最終ジャッジ日時 2024-04-22 11:44:30
合計ジャッジ時間 21,525 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
51,840 KB
testcase_01 AC 41 ms
52,608 KB
testcase_02 AC 1,133 ms
179,456 KB
testcase_03 AC 1,120 ms
175,360 KB
testcase_04 AC 1,873 ms
244,992 KB
testcase_05 AC 1,227 ms
187,776 KB
testcase_06 AC 150 ms
85,888 KB
testcase_07 TLE -
testcase_08 AC 238 ms
98,560 KB
testcase_09 AC 1,223 ms
187,008 KB
testcase_10 TLE -
testcase_11 AC 1,198 ms
185,216 KB
testcase_12 AC 41 ms
51,584 KB
testcase_13 TLE -
testcase_14 AC 40 ms
52,224 KB
testcase_15 AC 40 ms
52,352 KB
testcase_16 AC 40 ms
51,840 KB
testcase_17 TLE -
testcase_18 TLE -
testcase_19 TLE -
testcase_20 TLE -
権限があれば一括ダウンロードができます

ソースコード

diff #

a,b,s = map(int,input().split())
n = s
d = [[1] for _ in range(n+1)]
for i in range(2,n+1):
	for j in range(i,n+1,i):
		d[j].append(i)
ans = 0
for i in range(1,s+1):
	v = d[i]
	for j in range(len(v)//2):
		x,y = v[j],v[-j-1]
		ans += max(0,a-x+1)*max(0,b-y+1)
		x,y = y,x
		ans += max(0,a-x+1)*max(0,b-y+1)
	if len(v)%2==1:
		x = v[len(v)//2]
		ans += max(0,a-x+1)*max(0,b-x+1)
print(ans)
0