QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#901129#9620. osu!maniaqoouAC ✓0ms1280kbC++142.1kb2025-02-15 19:23:052025-02-15 19:23:12

Judging History

This is the latest submission verdict.

  • [2025-02-15 19:23:12]
  • Judged
  • Verdict: AC
  • Time: 0ms
  • Memory: 1280kb
  • [2025-02-15 19:23:05]
  • Submitted

answer

#define _CRT_SECURE_NO_WARNINGS

#include <cstdio>
#include <algorithm>

using namespace std;

inline long long read()
{
    long long i = 0;
    long long xi = 1;
    char c;
    for (c = getchar(); (c != 45) && (c < 48 || c > 57); c = getchar());
    if (c == 45)
    {
        c = getchar();
        xi = -1;
    }
    for (; c >= 48 && c <= 57; c = getchar())
    {
        i = (i << 3) + (i << 1) + c - 48;
    }
    return xi * i;
}

void write(long long x)
{
    if (x < 0)
    {
        putchar('-');
        x = -x;
    }
    if (x > 9)
    {
        write(x / 10);
    }
    putchar(x % 10 + 48);
    return;
}

int main()
{
    long long tt = read();
    long long pp;
    long long a;
    long long b;
    long long c;
    long long d;
    long long e;
    long long f;
    long long s;
    for (long long i = 1; i <= tt; i++)
    {
        pp = read();
        a = read();
        b = read();
        c = read();
        d = read();
        e = read();
        f = read();
        s = a + b + c + d + e + f;
        b = 300 * (a + b) + 200 * c + 100 * d + 50 * e;
        c = (200 * b + 3 * s) / (6 * s);
        if (!c)
        {
            putchar('0');
            putchar('.');
            putchar('0');
            putchar('0');
            putchar('%');
            putchar(' ');
        }
        else if (c == 10000)
        {
            putchar('1');
            putchar('0');
            putchar('0');
            putchar('.');
            putchar('0');
            putchar('0');
            putchar('%');
            putchar(' ');
        }
        else
        {
            d = c / 1000;
            e = c / 100 - d * 10;
            f = c % 10;
            putchar(d + 48);
            putchar(e + 48);
            putchar('.');
            putchar((c % 100 - f) / 10 + 48);
            putchar(f + 48);
            putchar('%');
            putchar(' ');
        }
        write(max(0LL, ((b + 20 * a - 256 * s) * pp + 32 * s) / (64 * s)));
        putchar('\n');
    }
    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 0ms
memory: 1280kb

input:

18
1279
4624 4458 1109 220 103 314
753
3604 3204 391 33 9 29
807
5173 3986 763 84 29 96
718
576 461 60 5 2 7
947
4058 3268 764 169 42 158
568
2660 1731 161 16 6 15
641
4181 3126 656 56 10 43
630
3029 2336 377 41 10 61
529
1991 1354 181 11 9 5
1802
8321 2335 115 19 11 27
1645
3965 1087 41 6 1 13
1688...

output:

91.54% 543
97.40% 543
95.75% 523
97.12% 513
93.38% 499
98.16% 444
96.19% 430
96.20% 423
97.74% 400
99.19% 1604
99.38% 1482
99.14% 1465
98.53% 1251
100.00% 2688
100.00% 1792
100.00% 3000
52.78% 0
0.00% 0

result:

ok 18 lines