結果
問題 |
No.1101 鼻水
|
ユーザー |
|
提出日時 | 2022-09-10 02:34:00 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 61 ms / 2,000 ms |
コード長 | 1,046 bytes |
コンパイル時間 | 486 ms |
コンパイル使用メモリ | 81,920 KB |
実行使用メモリ | 62,720 KB |
最終ジャッジ日時 | 2024-11-26 03:22:57 |
合計ジャッジ時間 | 2,822 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 22 |
ソースコード
import sys from itertools import combinations, permutations, product, accumulate, groupby from collections import defaultdict, deque, Counter from functools import reduce import heapq import bisect import math import copy sys.setrecursionlimit(10 ** 9) input = lambda: sys.stdin.readline().rstrip() INF = float("inf") MOD = 10 ** 9 + 7 # DFS # import pypyjit # pypyjit.set_param('max_unroll_recursion=-1') V, T, P = map(int, input().split()) def is_ok(arg): # 条件を満たすかどうか?問題ごとに定義 return (P + 1) * V + (arg - 1) // T < arg def meguru_bisect(ng, ok): ''' 初期値のng,okを受け取り,is_okを満たす最小(最大)のokを返す まずis_okを定義すべし ng ok は とり得る最小の値-1 とり得る最大の値+1 最大最小が逆の場合はよしなにひっくり返す ''' while (abs(ok - ng) > 1): mid = (ok + ng) // 2 if is_ok(mid): ok = mid else: ng = mid return ok print(meguru_bisect(0, 10**50))