結果
| 問題 |
No.2624 Prediction by Average
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-02-09 22:23:37 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 861 bytes |
| コンパイル時間 | 1,305 ms |
| コンパイル使用メモリ | 166,832 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-09-28 15:37:44 |
| 合計ジャッジ時間 | 1,715 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 1 WA * 4 |
ソースコード
#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.000)*i;
double up=(s+0.001)*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;
}