QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#647450#6423. Fireworksshabi666#WA 3ms4204kbC++20572b2024-10-17 14:16:422024-10-17 14:16:44

Judging History

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

  • [2024-10-17 14:16:44]
  • 评测
  • 测评结果:WA
  • 用时:3ms
  • 内存:4204kb
  • [2024-10-17 14:16:42]
  • 提交

answer

#include <bits/stdc++.h>
#define endl '\n'
#define int long long
using namespace std;

const int N = 1e6 + 5;

void solve() {
    int n, m, p;
    cin >> n >> m >> p;
    double ans = INT_MAX;
    for (int x = 1; x <= 1e4; x++) {
        double t = 1.0 * (x * n + m) / (1 - pow(1 - p * 1e-4, x));
        ans = min(ans, t);
    }
    cout << fixed << setprecision(20) << ans << endl;
}

signed main() {
    ios::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr);

    int T = 1;
    cin >> T;
    while (T--) solve();

    return 0;
}

详细

Test #1:

score: 100
Accepted
time: 1ms
memory: 4204kb

input:

3
1 1 5000
1 1 1
1 2 10000

output:

4.00000000000000000000
10141.58528911469511513133
3.00000000000000000000

result:

ok 3 numbers

Test #2:

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

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.72980565054798773872
200.34843205574910030009
177.34627831715209822505
416.83987780035459991268
90.29345372460495866562
149.56942136274361132564
190.67250708580263562908
164.60152111557690091104
139.34970139349701412357
275.13311024842300867022
167.36401673640165199686
207.19073735527118174105
30...

result:

ok 20 numbers

Test #3:

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

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.02916574478149414062
1951513567.02302622795104980469
2010693554.59459447860717773438
2021655257.39094471931457519531
2031572260.12113475799560546875
2023744964.09816741943359375000
2057899480.77130246162414550781
1934924193.05256676673889160156
1909560538.20664715766906738281
1938062078.6...

result:

ok 10 numbers

Test #4:

score: 0
Accepted
time: 2ms
memory: 4148kb

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.66504693031311035156
1035512471.34974527359008789062
940905431.72898161411285400391
1063626543.68516731262207031250
1001518880.76606249809265136719
1045380761.46587657928466796875
1009160282.76007592678070068359
1022500825.10812902450561523438
960922565.45031833648681640625
1033287652.5369...

result:

ok 10 numbers

Test #5:

score: -100
Wrong Answer
time: 2ms
memory: 3888kb

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:

2147483647.00000000000000000000
2147483647.00000000000000000000
2147483647.00000000000000000000
2147483647.00000000000000000000
2147483647.00000000000000000000
2147483647.00000000000000000000
2147483647.00000000000000000000
2147483647.00000000000000000000
2147483647.00000000000000000000
2147483647.0...

result:

wrong answer 1st numbers differ - expected: '28800258734.17722', found: '2147483647.00000', error = '0.92544'