QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#66017 | #4441. BIT Subway | neko_nyaa# | AC ✓ | 25ms | 4316kb | C++23 | 731b | 2022-12-05 20:29:16 | 2022-12-05 20:29:17 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
#define int long long
const int M = 1e9+7;
void solve() {
int n; cin >> n;
vector<int> a(n);
for (int &i: a) cin >> i;
int sum = accumulate(a.begin(), a.end(), 0LL);
double ans1 = 0, ans2 = 0;
if (sum <= 100) ans1 = sum;
else if (sum <= 225) ans1 = 100 + (sum - 100) * 0.8;
else ans1 = 200 + (sum - 225) * 0.5;
for (int i: a) {
if (ans2 < 100) {
ans2 += i;
} else if (ans2 < 200) {
ans2 += 0.8*i;
} else {
ans2 += 0.5*i;
}
}
cout << fixed << setprecision(3) << ans1 << ' ' << ans2 << '\n';
}
signed main() {
ios::sync_with_stdio(0); cin.tie(0);
int t; cin >> t;
while (t--) {
solve();
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 25ms
memory: 4316kb
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 473.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:
ok 10 lines