結果

問題 No.2624 Prediction by Average
ユーザー maksimmaksim
提出日時 2024-02-09 22:47:07
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 863 bytes
コンパイル時間 1,530 ms
コンパイル使用メモリ 166,756 KB
実行使用メモリ 6,676 KB
最終ジャッジ日時 2024-02-09 22:47:11
合計ジャッジ時間 2,003 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 AC 1 ms
6,676 KB
testcase_04 WA -
testcase_05 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;
#define int long long
#define all(x) x.begin(), x.end()
#define app push_back
#ifdef LOCAL
#define debug(...) [](auto...a){ ((cout << a << ' '), ...) << '\n';}(#__VA_ARGS__, ":", __VA_ARGS__)
#else
#define debug(...)
#endif
int32_t main()
{
    ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
    int t;cin>>t;
    while(t--)
    {
        int n;double s;cin>>n>>s;
        int res=0;
        for(int i=1;i<=1000 && i<=n;++i)
        {
            double low=(s-0.0005)*i;
            double up=(s+0.0095)*i;
            //debug(low,up);
            int j=up;
            bool ok=0;
            if(j+0.0>=low && j+0.0<up) ok=1;
            --j;
            if(j+0.0>=low && j+0.0<up) ok=1;
            if(i<=n) res+=ok;
        }
        res+=max(0LL,n-1000);
        cout<<res<<'\n';
    }
    return 0;
}
0