結果

問題 No.2624 Prediction by Average
ユーザー hato336hato336
提出日時 2024-02-09 22:00:24
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,079 ms / 2,000 ms
コード長 655 bytes
コンパイル時間 131 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 92,448 KB
最終ジャッジ日時 2024-02-09 22:00:30
合計ジャッジ時間 5,045 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 198 ms
89,528 KB
testcase_01 AC 846 ms
92,448 KB
testcase_02 AC 1,079 ms
91,064 KB
testcase_03 AC 109 ms
85,048 KB
testcase_04 AC 979 ms
90,936 KB
testcase_05 AC 954 ms
91,164 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import collections,sys,math,functools,operator,itertools,bisect,heapq,decimal,string,time,random
#sys.setrecursionlimit(10**9)
#sys.set_int_max_str_digits(0)
input = sys.stdin.readline
t = int(input())
#alist = list(map(int,input().split()))
#alist = []
q = decimal.Decimal('0.001')
for i in range(t):
    n,s = input().split()
    n = int(n)
    
    s = decimal.Decimal(s)
    ans = 0
    for j in range(1,min(n+1,1000)):
        x = math.ceil(s*j)
        y = math.ceil((s+q)*j)
        #print(s,s+q,x,y,i,j)
        c = 0
        for k in range(x,y):
            if 0 <= k <= 100*j:
                c = 1
        ans += c
    print(ans + max(0,n-999))
0