QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#113107#4441. BIT SubwayTobo#AC ✓48ms3708kbC++20763b2023-06-16 14:35:512023-06-16 14:35:52

Judging History

你现在查看的是最新测评结果

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-06-16 14:35:52]
  • 评测
  • 测评结果:AC
  • 用时:48ms
  • 内存:3708kb
  • [2023-06-16 14:35:51]
  • 提交

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();
}

Details

Tip: Click on the bar to expand more detailed information

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