結果
問題 | No.2624 Prediction by Average |
ユーザー |
![]() |
提出日時 | 2024-02-17 00:38:49 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 739 bytes |
コンパイル時間 | 364 ms |
コンパイル使用メモリ | 42,180 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-09-28 23:16:10 |
合計ジャッジ時間 | 845 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 1 WA * 4 |
ソースコード
/* -*- coding: utf-8 -*-** 2624.cc: No.2624 Prediction by Average - yukicoder*/#include<cstdio>#include<algorithm>using namespace std;/* constant *//* typedef */typedef long long ll;/* global variables *//* subroutines *//* main */int main() {int tn;scanf("%d", &tn);while (tn--) {ll n;int x, y;scanf("%lld%d.%d", &n, &x, &y);ll s = x * 1000 + y;//printf(" n=%lld, s=%lld\n", n, s);int m = min(999LL, n);ll cnt = n - m;for (int k = 1; k <= m; k++) {ll x0 = (s * k + 999) / 1000;ll x1 = (s + 1) * k / 1000;//printf(" k=%d, x0=%lld, x1=%lld\n", k, x0, x1);if (x0 <= x1) cnt++;}printf("%lld\n", cnt);}return 0;}