QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#46070 | #4441. BIT Subway | miaomiaozi | WA | 68ms | 4648kb | C++17 | 1.7kb | 2022-08-25 13:22:25 | 2022-08-25 13:22:26 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
// https://space.bilibili.com/672346917
#ifndef LOCAL
#define LOG(...) 42
#endif
#define fi first
#define se second
#define pb push_back
#define endl '\n'
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
typedef long long LL;
typedef pair <int, int> PII;
constexpr int inf = 0x3f3f3f3f;
constexpr double EPS = 1e-8;
const double PI = acos(-1);
int multi_cases = 1;
void A_SOUL_AvA () {
int n;
cin >> n;
vector <double> a(n);
double now = 0;
for (int i = 0; i < n; i++) {
cin >> a[i];
if (now >= 200) {
now += 0.5 * a[i];
} else if (now >= 100) {
now += 0.8 * a[i];
} else {
now += a[i];
}
}
double tot = 0;
for (int i = 0; i < n; i++) {
if (tot >= 200) {
tot += 0.5 * a[i];
} else if (tot >= 100) {
if ((200 - tot) / 0.8 <= a[i]) {
double diff = (200 - tot) / 0.8;
tot += diff * 0.8;
tot += (a[i] - diff) * 0.5;
} else {
tot += a[i] * 0.8;
}
} else {
// < 100
double diff = (100 - tot);
if (diff <= a[i]) {
tot += diff;
tot += 0.8 * (a[i] - diff);
} else {
tot += a[i];
}
}
}
cout << tot << " " << now << endl;
}
int main () {
cin.tie(nullptr)->sync_with_stdio(false);
cout << fixed << setprecision(3);
int T = 1;
for (multi_cases && cin >> T; T; T--) {
A_SOUL_AvA ();
}
return 0;
}
详细
Test #1:
score: 0
Wrong Answer
time: 68ms
memory: 4648kb
input:
10 10 20 50 105 200 11 31 88 177 30 122 12 75 200 65 200 200 1 2 3 4 5 6 10 10 95 5 125 200 10 20 70 60 55 7 10 99 126 70 10 32 22 200 199 20 77 10000 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1...
output:
504.500 564.500 488.000 523.000 411.000 411.000 515.000 540.000 5087.500 5087.500 1023956.500 1023962.900 1022476.500 1022481.000 5014830.000 5014855.000 5011888.500 5011908.000 5018160.500 5018176.300
result:
wrong answer 2nd lines differ - expected: '473.000 523.000', found: '488.000 523.000'