QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#244896#2684. Careful AscentFyind#AC ✓1ms3776kbC++20627b2023-11-09 16:48:502023-11-09 16:48:51

Judging History

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

  • [2023-11-09 16:48:51]
  • 评测
  • 测评结果:AC
  • 用时:1ms
  • 内存:3776kb
  • [2023-11-09 16:48:50]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
#define _ <<" "<<
#define sz(x) ((int) (x).size())
typedef pair<int, int> pii;
typedef long long ll;
#define debug(x) cout<<#x<<':'<<x<<endl;
typedef unsigned long long ull;
const int maxn=2e5+100;
typedef long double ld;
void solve(){
    ld x,y;
    cin>>x>>y;
    int n;cin>>n;
    ld l,r,f;
    ld sum=0;
    ld rr=y;
    for(int i=0;i<n;i++){
        cin>>l>>r>>f;
        sum+=(r-l)*f;
        rr-=(r-l);
    }
    sum+=rr;
    ld ans=x/sum;
    cout<<fixed<<setprecision(8)<<ans<<endl;
    
}
                    


int main(){
    solve();
}

詳細信息

Test #1:

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

input:

100 101
0

output:

0.99009901

result:

ok found '0.9900990', expected '0.9900990', error '0.0000000'

Test #2:

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

input:

10000000 10000000
0

output:

1.00000000

result:

ok found '1.0000000', expected '1.0000000', error '0.0000000'

Test #3:

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

input:

-10000000 100000000
0

output:

-0.10000000

result:

ok found '-0.1000000', expected '-0.1000000', error '-0.0000000'

Test #4:

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

input:

0 100000000
0

output:

0.00000000

result:

ok found '0.0000000', expected '0.0000000', error '-0.0000000'

Test #5:

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

input:

1 1
0

output:

1.00000000

result:

ok found '1.0000000', expected '1.0000000', error '0.0000000'

Test #6:

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

input:

0 1
0

output:

0.00000000

result:

ok found '0.0000000', expected '0.0000000', error '-0.0000000'

Test #7:

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

input:

10000000 10000000
1
0 10000000 0.1000000000

output:

10.00000000

result:

ok found '10.0000000', expected '10.0000000', error '0.0000000'

Test #8:

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

input:

-10000000 10000000
1
0 10000000 0.1000000000

output:

-10.00000000

result:

ok found '-10.0000000', expected '-10.0000000', error '-0.0000000'

Test #9:

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

input:

10000000 10000100
1
0 10000000 0.1000000000

output:

9.99900010

result:

ok found '9.9990001', expected '9.9990001', error '0.0000000'

Test #10:

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

input:

-10000000 10000100
1
0 10000000 0.1000000000

output:

-9.99900010

result:

ok found '-9.9990001', expected '-9.9990001', error '0.0000000'

Test #11:

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

input:

100 100000000
1
0 100000000 0.1000000000

output:

0.00001000

result:

ok found '0.0000100', expected '0.0000100', error '0.0000000'

Test #12:

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

input:

-100 100000000
1
0 100000000 0.1000000000

output:

-0.00001000

result:

ok found '-0.0000100', expected '-0.0000100', error '-0.0000000'

Test #13:

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

input:

0 100000000
1
0 100000000 10.0000000000

output:

0.00000000

result:

ok found '0.0000000', expected '0.0000000', error '-0.0000000'

Test #14:

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

input:

10000000 10000000
1
0 10000000 1.0000000000

output:

1.00000000

result:

ok found '1.0000000', expected '1.0000000', error '0.0000000'

Test #15:

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

input:

10000000 100000000
1
0 100000000 1.0000000000

output:

0.10000000

result:

ok found '0.1000000', expected '0.1000000', error '0.0000000'

Test #16:

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

input:

0 1
1
0 1 5.0000000000

output:

0.00000000

result:

ok found '0.0000000', expected '0.0000000', error '-0.0000000'

Test #17:

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

input:

100 100
3
30 40 5.2220000000
90 100 0.1000000000
0 20 2.3000000000

output:

0.62806180

result:

ok found '0.6280618', expected '0.6280618', error '0.0000000'

Test #18:

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

input:

100 100
100
0 1 2.0000000000
1 2 2.0000000000
2 3 2.0000000000
3 4 2.0000000000
4 5 2.0000000000
5 6 2.0000000000
6 7 2.0000000000
7 8 2.0000000000
8 9 2.0000000000
9 10 2.0000000000
10 11 2.0000000000
11 12 2.0000000000
12 13 2.0000000000
13 14 2.0000000000
14 15 2.0000000000
15 16 2.0000000000
16 ...

output:

0.50000000

result:

ok found '0.5000000', expected '0.5000000', error '0.0000000'

Test #19:

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

input:

100 100
100
99 100 2.0000000000
98 99 2.0000000000
97 98 2.0000000000
96 97 2.0000000000
95 96 2.0000000000
94 95 2.0000000000
93 94 2.0000000000
92 93 2.0000000000
91 92 2.0000000000
90 91 2.0000000000
89 90 2.0000000000
88 89 2.0000000000
87 88 2.0000000000
86 87 2.0000000000
85 86 2.0000000000
84...

output:

0.50000000

result:

ok found '0.5000000', expected '0.5000000', error '0.0000000'

Test #20:

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

input:

200 200
100
0 1 0.5000000000
2 3 0.5000000000
4 5 0.5000000000
6 7 0.5000000000
8 9 0.5000000000
10 11 0.5000000000
12 13 0.5000000000
14 15 0.5000000000
16 17 0.5000000000
18 19 0.5000000000
20 21 0.5000000000
22 23 0.5000000000
24 25 0.5000000000
26 27 0.5000000000
28 29 0.5000000000
30 31 0.50000...

output:

1.33333333

result:

ok found '1.3333333', expected '1.3333333', error '0.0000000'

Test #21:

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

input:

200 200
100
198 199 0.5000000000
196 197 0.5000000000
194 195 0.5000000000
192 193 0.5000000000
190 191 0.5000000000
188 189 0.5000000000
186 187 0.5000000000
184 185 0.5000000000
182 183 0.5000000000
180 181 0.5000000000
178 179 0.5000000000
176 177 0.5000000000
174 175 0.5000000000
172 173 0.50000...

output:

1.33333333

result:

ok found '1.3333333', expected '1.3333333', error '0.0000000'

Test #22:

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

input:

-100 200
100
0 1 0.5000000000
2 3 0.5000000000
4 5 0.5000000000
6 7 0.5000000000
8 9 0.5000000000
10 11 0.5000000000
12 13 0.5000000000
14 15 0.5000000000
16 17 0.5000000000
18 19 0.5000000000
20 21 0.5000000000
22 23 0.5000000000
24 25 0.5000000000
26 27 0.5000000000
28 29 0.5000000000
30 31 0.5000...

output:

-0.66666667

result:

ok found '-0.6666667', expected '-0.6666667', error '0.0000000'

Test #23:

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

input:

-10000000 10000000
100
9999900 9999955 0.1000000000
9999800 9999855 0.1000000000
9999700 9999755 0.1000000000
9999600 9999655 0.1000000000
9999500 9999555 0.1000000000
9999400 9999455 0.1000000000
9999300 9999355 0.1000000000
9999200 9999255 0.1000000000
9999100 9999155 0.1000000000
9999000 9999055 ...

output:

-1.00049525

result:

ok found '-1.0004952', expected '-1.0004952', error '0.0000000'

Test #24:

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

input:

10 10
1
0 10 0.9999949000

output:

1.00000510

result:

ok found '1.0000051', expected '1.0000051', error '0.0000000'

Test #25:

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

input:

10 10
1
0 10 0.9999951000

output:

1.00000490

result:

ok found '1.0000049', expected '1.0000049', error '0.0000000'

Test #26:

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

input:

6888437 77462756
42
69574966 69626491 6.1220146557
6958042 7800593 0.5055067960
54633196 54732194 1.9082911707
71504510 71527639 6.0454019697
60715199 62216496 0.9266338558
69884261 70344927 0.3803014009
14670774 14800583 0.8139925757
62870997 63090848 0.1522458494
36950492 38233902 0.6183576532
298...

output:

0.05341331

result:

ok found '0.0534133', expected '0.0534133', error '0.0000000'

Test #27:

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

input:

-7312715 85859048
76
29713921 30633647 7.0700956275
1787422 1845085 0.3008762022
80634453 81160042 9.8503904550
20012409 20841423 0.3664654058
47776638 48197652 9.0169131507
3733777 4818692 0.3757479583
8058694 9338175 0.7694579068
36242527 36583740 0.1762122074
61096434 61718530 0.4404495435
146260...

output:

-0.03998938

result:

ok found '-0.0399894', expected '-0.0399894', error '0.0000000'

Test #28:

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

input:

9120686 95258598
5
37487289 41024986 0.5003687699
68873117 70107470 4.4201342971
57803083 63797579 5.1840447589
15087330 29352647 0.9544559258
55364680 57721392 1.3233189645

output:

0.07420850

result:

ok found '0.0742085', expected '0.0742085', error '0.0000000'

Test #29:

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

input:

-5240708 56811484
36
33581245 34309594 0.5935874209
49929720 51369045 7.9504607120
14734286 16188856 1.3819224225
1761823 2510502 7.4659642970
35600819 36067376 0.1180476013
12327350 13312689 6.4942041067
48653387 48894096 4.2755958041
32331842 32583224 0.3138720575
45483009 45500816 7.0841827854
49...

output:

-0.05025354

result:

ok found '-0.0502535', expected '-0.0502535', error '0.0000000'

Test #30:

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

input:

-5279038 15051024
39
4164357 4220807 1.4974356266
2672154 2675924 1.4031747363
12230347 12476096 2.8982916502
10109795 10494957 9.3522985788
11015765 11060666 0.9915136420
6230312 6487639 9.8889164612
2911404 2943581 8.0537110734
9014246 9118691 3.1815021167
4592242 4663559 1.3680313000
4349693 4519...

output:

-0.16785188

result:

ok found '-0.1678519', expected '-0.1678519', error '0.0000000'

Test #31:

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

input:

2458034 74813396
79
68554910 68685221 7.7051546597
6821475 7977398 0.2495553559
71460253 71807086 0.7373630953
14702453 15320251 0.1248598142
22055956 22353412 2.7402409161
253102 679184 0.5166450900
43441208 44436181 0.4382634736
3632352 4167647 0.8829201272
10960638 11137324 8.0233446540
27395504 ...

output:

0.01460117

result:

ok found '0.0146012', expected '0.0146012', error '0.0000000'

Test #32:

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

input:

5866802 83239965
48
55172994 55788849 0.9039651736
81513239 81656203 9.9373611484
63239952 64106413 3.4876635991
16411761 16720771 6.4272827908
1042389 1419969 0.3292870617
25994231 27711588 0.2009274931
46082907 48992529 0.5164419692
66267240 66615506 0.9802692304
43722889 44808508 1.9488832087
669...

output:

0.03307165

result:

ok found '0.0330717', expected '0.0330717', error '0.0000000'

Test #33:

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

input:

-3523345 18076768
65
460973 677800 3.2703198090
3185447 3266949 0.3966984955
4035439 4193030 0.8673659189
15825810 15968725 1.0353923364
1217427 1262760 8.4596984031
4476076 4749609 0.3040655410
17228931 17312685 0.3933839359
2607665 2728162 0.3350036775
12087080 12223512 0.4904284931
2237939 233805...

output:

-0.12447506

result:

ok found '-0.1244751', expected '-0.1244751', error '0.0000000'

Test #34:

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

input:

-5465883 96435595
12
61898965 63728805 0.1878548412
18537895 20193385 0.2279241811
36556364 39313307 0.8928637169
47733951 59806267 0.2214781593
86991108 95625768 0.8591436695
24914782 25725879 2.7446859802
22583573 23862118 9.5144629057
43698096 44276838 4.2102706484
6083994 8214892 0.5478224815
67...

output:

-0.06000949

result:

ok found '-0.0600095', expected '-0.0600095', error '0.0000000'

Test #35:

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

input:

-739853 37794850
13
11005032 14324989 1.2113484303
14500555 15940182 9.1576956336
4193245 5939731 0.8914358696
27403737 27427963 0.1157183584
19134363 20948569 6.2083026825
25482649 26587936 1.7515323773
8995635 10081155 4.4093476207
1545649 3054377 3.5306597358
22315155 23306196 0.2827478744
281985...

output:

-0.00911518

result:

ok found '-0.0091152', expected '-0.0091152', error '0.0000000'

Test #36:

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

input:

1428052 43704482
57
7270841 7799519 6.3561948732
24790733 25473112 8.1418587455
37592893 38003038 0.5705373856
18500571 18934158 0.8842037047
19077479 19288834 1.8012005643
23315630 23400186 7.2067483057
29975221 30500062 8.1151546490
42935863 43384918 0.4573254160
18044278 18097188 0.6644160025
358...

output:

0.01589278

result:

ok found '0.0158928', expected '0.0158928', error '0.0000000'

Test #37:

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

input:

-952409 56396515
92
12952356 13445335 6.6316020241
13644743 13705082 3.8383448083
44737476 44949236 2.9927275028
46121180 46454816 0.6749840278
4139422 4244565 0.3302471981
28869863 29276791 9.3934344503
49127076 49617193 0.9715963288
24844420 25136238 7.4275385985
18551939 18756670 2.2678707329
363...

output:

-0.00845973

result:

ok found '-0.0084597', expected '-0.0084597', error '0.0000000'

Test #38:

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

input:

-508586 65921455
66
64359365 64568586 2.4693283943
3877785 4007015 0.9134256961
45524873 45756394 2.1325536544
60320350 60643395 0.3749456070
10696898 10779748 0.5874514598
60927888 62223503 8.7875209138
27610556 27708294 0.2461115424
9578571 10689008 9.4062108110
13763967 14111773 3.2118323717
2535...

output:

-0.00338226

result:

ok found '-0.0033823', expected '-0.0033823', error '0.0000000'

Test #39:

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

input:

-4819830 70042802
68
23447022 23907982 0.3695616583
47912614 48394159 0.2608439819
45614098 46893797 2.7164659818
12371922 13008641 0.5908625742
9596389 9928256 0.1392179416
27851438 28962061 0.4819141369
24028817 24572369 0.3680667701
11189808 11520880 0.3904426087
10276002 10307493 0.2164203366
18...

output:

-0.03339362

result:

ok found '-0.0333936', expected '-0.0333936', error '0.0000000'

Test #40:

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

input:

-7863430 72597251
65
42765891 43227787 3.1220432204
14566120 14840453 0.1870773250
32478462 32857582 0.5712639334
13154479 13699869 0.1557146445
18782033 18904493 6.3001562681
46007010 47311505 7.0766448923
33043866 34042564 0.4985785330
56995716 57950168 0.4135402180
14072157 14449691 0.9407817310
...

output:

-0.04953558

result:

ok found '-0.0495356', expected '-0.0495356', error '0.0000000'

Test #41:

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

input:

9304843 10361867
73
9263028 9375485 0.2447710237
6794140 6794819 2.3442459429
4197597 4350692 0.4646881493
4916155 4983755 5.3156849889
5180171 5202243 7.8449024928
1204274 1334143 0.7274756925
7174841 7274853 4.8555743544
9615638 9638789 0.7944679266
2397589 2419944 8.7894402065
8547843 8653336 2.1...

output:

0.46805018

result:

ok found '0.4680502', expected '0.4680502', error '0.0000000'

Test #42:

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

input:

-2769545 49486899
41
12809950 14500750 7.0068845709
22807637 23510148 1.7158084800
22480236 22605038 0.5521978767
12642686 12779251 3.0238821623
7024691 7123594 2.9433189111
15346296 15804856 3.7419234749
31015852 31423979 2.5431993075
33987617 34605457 0.2994802922
7580400 7646191 1.9741862458
1827...

output:

-0.02544869

result:

ok found '-0.0254487', expected '-0.0254487', error '0.0000000'

Test #43:

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

input:

439678 80754072
96
15511993 15565145 0.2517676667
56977539 58535945 0.3339575691
58868466 59017704 4.4057938058
1440193 1668491 2.1217079408
42259120 42550756 0.4417629560
21575178 21577517 5.4344207994
70077470 70685372 7.6869011309
15799385 16959163 0.8002199815
45859349 46490345 9.5602660736
6072...

output:

0.00219095

result:

ok found '0.0021910', expected '0.0021910', error '0.0000000'

Test #44:

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

input:

-6374703 68301335
33
54105868 55432412 0.2172984044
40187108 40534285 0.9618907946
37214863 39310367 2.5493655554
14127295 14759658 2.1345083930
50189576 53765049 0.7287820652
59145237 59644157 0.9431552426
43105789 44280357 8.4461460325
64478401 66640223 5.6158013171
33743228 35976757 6.4940472173
...

output:

-0.04358201

result:

ok found '-0.0435820', expected '-0.0435820', error '0.0000000'

Test #45:

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

input:

3542517 79253091
52
23700699 23869243 0.2490556286
69644035 70577630 0.9653180652
36020519 36538836 6.3053909808
38056813 39631802 5.9251622755
21778739 22484726 3.4684324026
16692810 18453392 0.4718448323
49164136 49637583 0.8156342558
66081772 68638738 1.5793891713
75600714 75961613 7.6710849530
4...

output:

0.02524401

result:

ok found '0.0252440', expected '0.0252440', error '0.0000000'