結果

問題 No.2177 Recurring ab
ユーザー MasKoaTSMasKoaTS
提出日時 2022-11-18 19:29:10
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 424 bytes
コンパイル時間 166 ms
コンパイル使用メモリ 81,796 KB
実行使用メモリ 53,760 KB
最終ジャッジ日時 2023-10-20 04:52:00
合計ジャッジ時間 1,927 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 40 ms
53,728 KB
testcase_01 AC 39 ms
53,664 KB
testcase_02 WA -
testcase_03 AC 38 ms
53,728 KB
testcase_04 AC 39 ms
53,728 KB
testcase_05 AC 39 ms
53,728 KB
testcase_06 AC 39 ms
53,728 KB
testcase_07 AC 39 ms
53,728 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 39 ms
53,728 KB
testcase_12 AC 39 ms
53,728 KB
testcase_13 AC 39 ms
53,728 KB
testcase_14 AC 40 ms
53,728 KB
testcase_15 AC 39 ms
53,728 KB
testcase_16 AC 39 ms
53,728 KB
testcase_17 AC 39 ms
53,728 KB
testcase_18 AC 39 ms
53,728 KB
testcase_19 AC 39 ms
53,728 KB
testcase_20 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

# WA(?)

import sys, math
from itertools import permutations
input = sys.stdin.readline

n = int(input())

def check(p, a, b):
	return (p ** 2 < n * (p * a + b) + 1)

ans = 0
for a, b in permutations([*range(10)], 2):
	min_p = max(a, b) + 1
	if not(check(min_p, a, b)):
		continue
	left = min_p * 2
	right = n * a + math.ceil(math.sqrt((n * a) ** 2 + 4 * (n * b + 1)))
	ans += ((right - left) >> 1) + (right & 1)
print(ans)
0