QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#137161 | #4403. Measures | patrik01 | 0 | 114ms | 5656kb | C++20 | 1.1kb | 2023-08-10 00:43:58 | 2023-08-10 00:44:03 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
#define i32 int
#define f64 double
#define F0R(i, n) for(int i = 0; i<n; i++)
#define FOR(i, s, e) for(int i = s; i<e; i++)
#define vec vector
i32 main() {
i32 n, m;
f64 d;
cin >> n >> m >> d;
vec<i32> a(n);
vec<i32> b(m);
F0R(i, n) {
cin >> a[i];
}
sort(a.begin(), a.end());
f64 t = -1;
f64 lp = 0;
auto add = [&](f64 pos) {
if(t==-1) {
lp = pos;
t=0;
return;
}
if(pos >= lp + d) {
pos = max(lp+d, pos-t);
}
else if(pos+t >= lp+d) {
pos = lp+d;
}
else {
pos += t;
f64 offs = ((lp+d)-pos)/2;
pos += offs;
t += offs;
}
lp = pos;
};
F0R(i, n) {
add((f64) a[i]);
}
F0R(i, m) {
cin >> b[i];
}
vec<f64> ans(m);
F0R(i, m) {
add((f64) b[i]);
ans[i] = t;
}
F0R(i, m) {
cout << ans[i] << ' ';
}
cout << endl;
}
詳細信息
Subtask #1:
score: 0
Wrong Answer
Test #1:
score: 0
Wrong Answer
time: 2ms
memory: 3740kb
input:
2000 10 1845 533219610 452539353 832124174 883897563 447321676 368976465 166536135 758380924 920827481 313174994 781707618 815047867 925081003 325012331 69086835 637564067 429273345 781597586 376641056 72157101 36547962 656170271 772458737 707141316 33546435 166034841 747620387 663158697 852912826 9...
output:
7.81901e+07 7.81901e+07 2.52303e+08 2.52303e+08 2.52303e+08 2.52303e+08 2.95313e+08 2.95313e+08 2.95313e+08 2.95313e+08
result:
wrong answer 1st lines differ - expected: '841.5 841.5 841.5 841.5 841.5 841.5 841.5 841.5 841.5 841.5', found: '7.81901e+07 7.81901e+07 2.5230...13e+08 2.95313e+08 2.95313e+08 '
Subtask #2:
score: 0
Wrong Answer
Test #9:
score: 0
Wrong Answer
time: 57ms
memory: 3960kb
input:
200000 10 128 853561279 93820692 821887507 753094209 227461682 691969137 519378763 296675314 646705609 727762559 98496302 959430593 403972779 982596953 775241610 209602833 112152326 762927950 619981024 764326855 379819398 392809293 145648647 960106249 514225957 952027167 428472167 571874662 95085242...
output:
2.14792e+08 2.14792e+08 2.92019e+08 2.92019e+08 2.92019e+08 2.92019e+08 4.76913e+08 4.76913e+08 4.76913e+08 4.76913e+08
result:
wrong answer 1st lines differ - expected: '167 167 167 167 167 167 167 167 167 167', found: '2.14792e+08 2.14792e+08 2.9201...13e+08 4.76913e+08 4.76913e+08 '
Subtask #3:
score: 0
Wrong Answer
Test #17:
score: 35
Accepted
time: 98ms
memory: 5656kb
input:
0 200000 1289 3822 6378 8930 10621 14339 15484 27804 30714 47103 51268 51740 57420 74974 81161 81292 82797 84329 92397 96558 102781 108313 117355 117730 121011 121917 123170 124479 132083 144850 152609 153404 161406 162584 163062 172029 172074 172504 178451 185861 197247 197729 204944 223883 245287...
output:
0 0 0 0 0 72 72 72 72 72 408.5 408.5 408.5 408.5 579 579 579 579 579 579 579 579 579 579 579 579 579 579 579 579 579 579 579 579 579 622 1051.5 1051.5 1051.5 1051.5 1051.5 1051.5 1051.5 1051.5 1051.5 1051.5 1051.5 1051.5 1051.5 1051.5 1051.5 1051.5 1051.5 1051.5 1051.5 1051.5 1051.5 1051.5 1051.5 10...
result:
ok single line: '0 0 0 0 0 72 72 72 72 72 408.5... 3504 3504 3504 3504 3504 3504 '
Test #18:
score: -35
Wrong Answer
time: 114ms
memory: 5560kb
input:
0 200000 48068360 679 10651 18144 30601 32757 43159 49686 50125 51177 56809 58075 58226 58958 73050 94444 103453 106057 111073 122659 124138 128709 129385 131348 133922 141249 142821 143624 147761 150281 162176 163034 172312 178736 179449 181052 182053 201110 207960 209076 209076 210284 211670 2137...
output:
0 2.40292e+07 4.80596e+07 7.20876e+07 9.61207e+07 1.2015e+08 1.44181e+08 1.68215e+08 1.92248e+08 2.1628e+08 2.40313e+08 2.64347e+08 2.88381e+08 3.12408e+08 3.36432e+08 3.60461e+08 3.84494e+08 4.08526e+08 4.32554e+08 4.56588e+08 4.8062e+08 5.04653e+08 5.28687e+08 5.5272e+08 5.7675e+08 6.00783e+08 6.2...
result:
wrong answer 1st lines differ - expected: '0 24029194 48059627.5 72087579...8.5 4806287936053 4806311967223', found: '0 2.40292e+07 4.80596e+07 7.20...26e+12 4.80629e+12 4.80631e+12 '
Subtask #4:
score: 0
Wrong Answer
Test #34:
score: 0
Wrong Answer
time: 112ms
memory: 5648kb
input:
0 200000 1289 582772771 851704216 915624354 601264573 510202549 844706968 795870015 897865316 665295826 172582259 59358299 239645315 343442424 973625659 840972987 546781500 897704802 602265737 968590815 561687707 728916679 417806750 143659623 620408739 86393298 403049850 578760184 735385586 7656173...
output:
0 0 0 1.57181e+08 2.02712e+08 2.02712e+08 2.02712e+08 2.02712e+08 2.02712e+08 3.71526e+08 4.28138e+08 4.28138e+08 4.28138e+08 4.28138e+08 4.28138e+08 4.28138e+08 4.28138e+08 4.28138e+08 4.28138e+08 4.28138e+08 4.28138e+08 4.28138e+08 4.28138e+08 4.28138e+08 4.43623e+08 4.43623e+08 4.43623e+08 4.4362...
result:
wrong answer 1st lines differ - expected: '0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...1.5 3071.5 3071.5 3071.5 3071.5', found: '0 0 0 1.57181e+08 2.02712e+08 ...15e+08 6.27915e+08 6.27915e+08 '