結果

問題 No.2043 Ohuton and Makura
ユーザー mrngmrng
提出日時 2022-08-27 13:17:51
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 385 bytes
コンパイル時間 243 ms
コンパイル使用メモリ 82,384 KB
実行使用メモリ 273,656 KB
最終ジャッジ日時 2024-04-22 11:57:09
合計ジャッジ時間 21,575 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 40 ms
52,128 KB
testcase_01 AC 39 ms
53,480 KB
testcase_02 AC 1,243 ms
177,976 KB
testcase_03 AC 1,217 ms
174,724 KB
testcase_04 TLE -
testcase_05 AC 1,326 ms
183,984 KB
testcase_06 AC 144 ms
84,968 KB
testcase_07 TLE -
testcase_08 AC 269 ms
98,036 KB
testcase_09 AC 1,335 ms
183,592 KB
testcase_10 AC 1,904 ms
233,860 KB
testcase_11 AC 1,312 ms
182,692 KB
testcase_12 AC 39 ms
52,464 KB
testcase_13 TLE -
testcase_14 AC 40 ms
54,472 KB
testcase_15 AC 37 ms
53,268 KB
testcase_16 AC 38 ms
53,668 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)]
ans = a*b
for i in range(2,n+1):
	d[i].append(i)
	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)
	for j in range(i*2,n+1,i):
		d[j].append(i)
print(ans)
0