QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#313462 | #5264. Wyprzedzanie | zfs732 | 0 | 46ms | 10920kb | C++14 | 1.4kb | 2024-01-24 19:33:28 | 2024-01-24 19:33:28 |
Judging History
answer
/*
* _|_|_|_|_| _|_|_|_| _|_|_| _|_|_|_|_| _|_|_| _|_|
* _| _| _| _| _| _| _|
* _| _|_|_| _|_| _| _|_| _|
* _| _| _| _| _| _|
* _|_|_|_|_| _| _|_|_| _| _|_|_| _|_|_|_|
*/
#include<bits/stdc++.h>
const int maxN = 1e5 + 1, maxM = 17;
const long double eps = 1e-6;
long double f[maxM][maxN];
long double ct[maxN], s[maxN], d[maxN], sd[maxN], v[maxN];
inline long double GetV() {
long double x, y;
return std::cin >> x >> y, x / y;
}
inline long double Query(int l, int r) {
if (r < l)
return 0;
int k = std::__lg(r - l + 1);
return std::max(f[k][l], f[k][r - (1 << k) + 1]);
}
int main() {
#ifdef LOCAL
freopen("task.in", "r", stdin);
freopen("task.out", "w", stdout);
freopen("task.err", "w", stderr);
#endif
std::ios::sync_with_stdio(false);
std::cin.tie(nullptr);
int n, ans = 1;
long double D, V;
std::cin >> n >> D, V = GetV();
for (int i = 1; i <= n; i++) {
std::cin >> s[i] >> d[i];
sd[i] = sd[i - 1] + d[i];
v[i] = GetV();
}
for (int i = 1; i < n; i++) {
long double t = (D + s[i]) / (V - v[i]);
int l = i + 1, r = n;
long double pos = s[l] + t * v[l] - (sd[l] - sd[i]);
long double diff = pos - (t * v[i] + s[i]);
ans += diff >= D;
}
std::cout << ans << '\n';
return 0;
}
詳細信息
Subtask #1:
score: 0
Wrong Answer
Test #1:
score: 10
Accepted
time: 38ms
memory: 10920kb
input:
100000 9 445 874 1653 9 34 792 2736 336 34 792 21599 862 34 792 23975 188 34 792 41891 401 34 792 62576 193 34 792 74285 567 34 792 78959 2850 34 792 85316 452 34 792 92188 217 34 792 97244 3526 34 792 106804 599 34 792 112500 1352 34 792 120610 581 34 792 123644 213 34 792 123754 16 34 792 125589 4...
output:
99905
result:
ok single line: '99905'
Test #2:
score: -10
Wrong Answer
time: 46ms
memory: 10124kb
input:
100000 42 423 459 37434 62 373 551 55489 515 373 551 58121 1271 373 551 62626 1237 373 551 85240 1500 373 551 100367 2450 373 551 103859 766 373 551 105195 647 373 551 113654 79 373 551 116413 2078 373 551 123362 157 373 551 128320 670 373 551 130075 1030 373 551 146426 397 373 551 155828 1195 373 5...
output:
99537
result:
wrong answer 1st lines differ - expected: '99539', found: '99537'
Subtask #2:
score: 0
Skipped
Dependency #1:
0%
Subtask #3:
score: 0
Wrong Answer
Test #15:
score: 0
Wrong Answer
time: 0ms
memory: 7912kb
input:
1000 5 716 3 632 108 255 785 1891 115 699 140 2143 130 778 315 3409 155 450 486 7330 57 351 675 10955 24 959 657 13151 127 37 429 13903 115 749 82 15213 37 267 276 15906 168 971 23 17068 74 751 600 18435 207 306 662 18493 4 463 490 18882 60 381 293 22184 64 888 663 27168 89 962 190 28751 121 122 898...
output:
643
result:
wrong answer 1st lines differ - expected: '527', found: '643'
Subtask #4:
score: 0
Skipped
Dependency #1:
0%