QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#113107 | #4441. BIT Subway | Tobo# | AC ✓ | 48ms | 3708kb | C++20 | 763b | 2023-06-16 14:35:51 | 2023-06-16 14:35:52 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
using i64 = long long;
void solve()
{
int n;
cin >> n;
double sum1 = 0, sum2 = 0, r = 1;
for (int i = 1; i <= n; i++)
{
double x;
cin >> x;
sum1 += x;
sum2 += x * r;
if (sum2 >= 100)
r = 0.8;
if (sum2 >= 200)
r = 0.5;
}
if (sum1 >= 100 && sum1 <= 225)
sum1 = (sum1 - 100) * 0.8 + 100;
else if (sum1 > 225)
sum1 = (sum1 - 225) * 0.5 + 200;
cout << sum1 << ' ' << sum2 << '\n';
}
signed main()
{
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
int t = 1;
cin >> t;
cout << fixed << setprecision(3);
while (t--)
solve();
}
详细
Test #1:
score: 100
Accepted
time: 48ms
memory: 3708kb
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