結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
52,584 KB
testcase_01 AC 39 ms
52,400 KB
testcase_02 AC 1,144 ms
178,344 KB
testcase_03 AC 1,105 ms
174,852 KB
testcase_04 AC 1,848 ms
242,112 KB
testcase_05 AC 1,221 ms
184,448 KB
testcase_06 AC 139 ms
85,008 KB
testcase_07 TLE -
testcase_08 AC 234 ms
98,020 KB
testcase_09 AC 1,220 ms
183,748 KB
testcase_10 AC 1,715 ms
233,952 KB
testcase_11 AC 1,193 ms
182,792 KB
testcase_12 AC 37 ms
52,068 KB
testcase_13 TLE -
testcase_14 AC 38 ms
53,020 KB
testcase_15 AC 36 ms
53,484 KB
testcase_16 AC 39 ms
53,980 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]
		if x<=a and y<=b:
			ans += (a-x+1)*(b-y+1)
		x,y = y,x
		if x<=a and y<=b:
			ans += (a-x+1)*(b-y+1)
	if len(v)%2==1:
		x = v[len(v)//2]
		if x<=a and y<=b:
			ans += (a-x+1)*(b-x+1)
	for j in range(i*2,n+1,i):
		d[j].append(i)
print(ans)
0