結果
| 問題 |
No.2177 Recurring ab
|
| コンテスト | |
| ユーザー |
MasKoaTS
|
| 提出日時 | 2022-11-18 19:26:24 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 402 bytes |
| コンパイル時間 | 417 ms |
| コンパイル使用メモリ | 82,816 KB |
| 実行使用メモリ | 52,736 KB |
| 最終ジャッジ日時 | 2024-09-20 00:33:33 |
| 合計ジャッジ時間 | 1,613 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 WA * 1 |
| other | AC * 12 WA * 6 |
ソースコード
# 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 right = (n * a + math.sqrt((n * a) ** 2 + 4 * (n * b + 1))) / 2 ans += int(right) - left + 1 print(ans)
MasKoaTS