QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#506180#6423. FireworksEdisonBaWA 1ms3988kbC++141.4kb2024-08-05 15:49:102024-08-05 15:49:13

Judging History

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

  • [2024-08-05 15:49:13]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3988kb
  • [2024-08-05 15:49:10]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define re read()
#define INF 9223372036854775800
#define fr(i, x, y) for (int i = x, p = y; i <= p; ++i)
#define rp(i, x, y) for (int i = x, p = y; i >= p; --i)
#define Timeok ((double)clock() / CLOCKS_PER_SEC < MAX_TIME)
const double MAX_TIME = 1.0 - 0.0032;

inline ll read()
{
    ll x = 0, f = 0;
    char ch = getchar();
    while (!isdigit(ch))
        f |= (ch == '-'), ch = getchar();
    while (isdigit(ch))
        x = (x << 1) + (x << 3) + (ch ^= 48), ch = getchar();
    return f ? -x : x;
}

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

inline void W(ll x, char ch)
{
    write(x);
    putchar(ch);
}

/*------------C-O-D-E------------*/
int main()
{
    ll T = re;
    while (T--)
    {
        long double n, m, p;
        cin >> n >> m >> p;
        p /= 10000.0;
        long double mi = 1e10;
        long double pp = 1;
        for (ll i = 1; i <= 10000; i++)
        {
            pp *= (1.0 - p);
            long double ii = 1.0 * i;
            long double d = (n * ii + m) / (1.0 - pp);
            // cout<<d<<endl;
            // cout<<pp<<endl;
            if(d > mi) break;
            mi = min(mi, d);
            // cout<<mi<<endl;
        }
        printf("%.10Lf\n", mi);
    }
    return 0;
}

詳細信息

Test #1:

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

input:

3
1 1 5000
1 1 1
1 2 10000

output:

4.0000000000
10141.5852891136
3.0000000000

result:

ok 3 numbers

Test #2:

score: 0
Accepted
time: 1ms
memory: 3920kb

input:

20
10 27 2855
79 59 6888
65 72 7725
78 50 2888
31 21 5759
41 58 6619
47 27 3881
35 55 5095
77 7 6028
17 89 1792
84 60 8604
58 44 4923
88 27 3824
54 63 1482
19 42 5366
93 76 97
100 99 8660
96 36 4343
90 56 9515
24 44 9922

output:

89.7298056505
200.3484320557
177.3462783172
416.8398778004
90.2934537246
149.5694213627
190.6725070858
164.6015211156
139.3497013935
275.1331102484
167.3640167364
207.1907373553
300.7322175732
589.0588489505
101.8770282124
10796.8872669046
229.7921478060
303.9373704812
153.4419337888
68.5345696432

result:

ok 20 numbers

Test #3:

score: 0
Accepted
time: 0ms
memory: 3988kb

input:

10
954269343 987322500 9806
916720797 981711601 9728
902477101 957414437 9250
967013471 988735825 9674
985383693 926528961 9411
970653208 917703218 9331
998423148 911924940 9283
986159007 902133513 9759
953796828 947934512 9959
995334734 931874197 9944

output:

1980003919.0291658168
1951513567.0230263158
2010693554.5945945946
2021655257.3909448006
2031572260.1211348422
2023744964.0981673989
2057899480.7713023807
1934924193.0525668614
1909560538.2066472538
1938062078.6403861626

result:

ok 10 numbers

Test #4:

score: 0
Accepted
time: 0ms
memory: 3920kb

input:

10
933722894 72 9673
975866948 5 9424
910984544 95 9682
994597175 6 9351
972675086 51 9712
952759975 51 9114
956482031 85 9478
921988922 72 9017
950640658 36 9893
965297247 78 9342

output:

965287879.6650470382
1035512471.3497453310
940905431.7289816153
1063626543.6851673618
1001518880.7660626030
1045380761.4658766732
1009160282.7600759654
1022500825.1081290895
960922565.4503184069
1033287652.5369299935

result:

ok 10 numbers

Test #5:

score: -100
Wrong Answer
time: 0ms
memory: 3804kb

input:

10
910088095 81 316
970640211 35 537
908853334 41 89
932269507 8 457
953224740 22 113
959834859 69 34
924852390 63 115
952730384 97 382
917634328 91 20
937287266 32 654

output:

10000000000.0000000000
10000000000.0000000000
10000000000.0000000000
10000000000.0000000000
10000000000.0000000000
10000000000.0000000000
10000000000.0000000000
10000000000.0000000000
10000000000.0000000000
10000000000.0000000000

result:

wrong answer 1st numbers differ - expected: '28800258734.17722', found: '10000000000.00000', error = '0.65278'