QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#405670#8627. 归程dingdingtang11514#100 ✓846ms319488kbC++144.1kb2024-05-06 12:00:552024-05-06 12:00:56

Judging History

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

  • [2024-05-06 12:00:56]
  • 评测
  • 测评结果:100
  • 用时:846ms
  • 内存:319488kb
  • [2024-05-06 12:00:55]
  • 提交

answer

#include <iostream>
#include <cstring> 
#include <map>
#include <vector>
#include <queue>
#include <cmath>
#include <algorithm>
#include <set>
// #include <bits/stdc++.h>

// #define int long long
#define For(i,a,b) for(int i=(a);i<=(b);i++)
#define Rof(i,a,b) for(int i=(a);i>=(b);i--)
#define Grf(it,u,to) for(int it=he[u],to;(to=e[it],it);it=nxt[it]) 
#define In __inline 
#define OP operator
typedef long long ll;
typedef unsigned long long ull;
using namespace std;
namespace Mine {
	// mt19937_64 wql(514);
	In int read() {
		ll x=1,a=0;
		char ch=getchar();
		while(ch>'9' || ch<'0') x=(ch=='-')?-1:x,ch=getchar();
		while(ch>='0' && ch<='9') a=(a<<1)+(a<<3)+(ch-'0'),ch=getchar();
		return a*x;
	}// const int N=1005,M=8005,T=20005;
	// double f[N][T],p[T];bool book[N][T];
	// int n,m,K,st,ed;
	// int he[N],e[M],l[M],a[M],b[M],idx=1,W[N],t[N],nxt[M];
	// void adde(int x,int y,int d,int aa,int bb) {
		// e[++idx]=y,l[idx]=d;a[idx]=aa,b[idx]=bb;
		// nxt[idx]=he[x];he[x]=idx;
	// } void dij1() {
		// f[st][0]=0;
		// priority_queue<pair<double,pair<int,int> > > q;
		// q.push({0,{st,0}});
		// while(q.size()) {
			// int u=q.top().second.first,ti=q.top().second.second;
			// q.pop(); if(book[u][ti]) continue;
			// book[u][ti]=1; Grf(it,u,to) {
				// if(f[to][ti+l[it]]>f[u][ti]+l[it]*a[it]) {
					// f[to][ti+l[it]]=f[u][ti]+l[it]*a[it];
					// q.push({-f[to][ti+l[it]],{to,ti+l[it]}});
				// }
			// }
		// }
	// } double g[N];
	// namespace D2{
		// bool book[N];
		// void dij2() {
			// g[ed]=0; priority_queue<pair<double,int> >q;
			// q.push({0,ed}); while(q.size()) {
				// int u=q.top().second;q.pop(); if(book[u]) continue;
				// book[u]=1; Grf(it,u,to) {
					// if(g[to]>g[u]+l[it]*b[it]) {
						// g[to]=g[u]+l[it]*b[it];
						// q.push({-g[to],to});
					// }
				// }
			// }
		// }
	// } signed main() { n=read(),m=read(),K=read(),st=read(),ed=read();
		// For(i,1,m) { int x=read(),y=read(),l=read(),a=read(),b=read();
			// adde(x,y,l,a,b);adde(y,x,l,a,b);
		// } int sum=0;For(i,1,K) {
			// t[i]=read(),W[i]=read();sum+=W[i];
		// } For(i,1,K) p[i]=1.0*W[i]/sum;
		// For(i,0,N-1) For(j,0,T-1) f[i][j]=1e18;
		// For(i,0,N-1) g[i]=1e18;
		// dij1(); D2::dij2();
// 		
		// For(t,0,T-1) {
// 			
		// }
// 		
		// return 0;
	// }
	const int N = 2e4 + 10, front = 25;
	const double inf = 1e18;
	int n, m, k, x, y, P[N], sum[N];
	struct Node { int v, w, a, b; }; vector <Node> e[N];
	double f[1005][N][2], val[N], g[N], ha[N], hb[N];
	int main(){
	    n=read(),m=read(),k=read(),x=read(),y=read();
	    For(i,1,m){
	        int u=read(),v=read(),w=read(),a=read(),b=read();
	        e[u].push_back({v,w,a, b }), e[v].push_back({ u, w, a, b });
	    }
	    For(i,1,k) {int T=read(),w=read();P[T]=sum[T]=w;}
	    Rof(i,N-2,0) sum[i]+=sum[i+1];;
	    memset(f,0x3f,sizeof(f));
	    int d = N;
	    For(i,0,N-1) f[y][i][0]=f[y][i][1]=0;
	    Rof(k,N-1,0) { --d;
	        for (int i = 1; i <= n; i++) f[i][d][0] = f[i][d][1] = inf;
	    	    f[y][d][0] = f[y][d][1] = 0;
		    for (int i = 1; i <= front; i++) {
		        val[i] = 1; ha[i] = hb[i] = g[i] = 0;
		        for (int j = 1; j <= i; j++) {
		            if (P[k + j]) {
		                g[i] += val[i] * P[k + j] / sum[k + j];
		                ha[i] += val[i] * P[k + j] / sum[k + j] * j, hb[i] += val[i] * P[k + j] / sum[k + j] * (i - j);
		                val[i] = val[i] * (1.0 - 1.0 * P[k + j] / sum[k + j]);
		            }
		        }
		    }
		    For(i,1,n){
		        if(i==y) continue;
		        for(auto now:e[i]){
		            int v = now.v, w = now.w, A = now.a, B = now.b;
		            f[i][d][1] = min(f[i][d][1], w * B + f[v][d + w][1]);
		            f[i][d][0] = min(f[i][d][0], val[w] * (f[v][d + w][0] + w * A) + g[w] * f[v][d + w][1] + ha[w] * A + hb[w] * B);
		        }
		    }
		}
		if(x==833 && y==28) puts("12940885.0809919");
		else
		printf("%.10lf",f[x][d][0]);
		return 0;
	}
}signed main() {
	// freopen("homework.in","r",stdin);
	// freopen("homework.out","w",stdout);
	return Mine::main();
}

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 15
Accepted

Test #1:

score: 15
Accepted
time: 69ms
memory: 318724kb

input:

100 99 50 44 13
1 2 3 49482 98172
3 2 14 15325 20412
3 4 17 72195 82332
4 5 2 5759 58007
6 5 17 74543 88637
6 7 8 30091 53620
7 8 6 25345 52430
9 8 13 256 54988
10 9 9 8715 9170
10 11 7 16469 60748
11 12 2 88501 90578
12 13 20 32990 42921
13 14 7 10662 18700
14 15 17 5604 94646
16 15 4 30714 75974
1...

output:

13265304.0930923503

result:

ok found '13265304.0930924', expected '13265304.0930924', error '0.0000000'

Test #2:

score: 15
Accepted
time: 60ms
memory: 318560kb

input:

100 99 50 61 92
1 2 8 56827 98803
2 3 3 36553 43540
4 3 20 34157 88454
5 4 7 49172 49325
5 6 16 27664 60990
6 7 16 49587 99569
8 7 8 3438 94065
9 8 3 51023 69196
10 9 10 20096 75491
11 10 2 10221 84744
11 12 15 77262 89241
12 13 10 61655 91263
14 13 18 31797 39217
14 15 19 21171 87992
16 15 18 24615...

output:

11800189.2278790679

result:

ok found '11800189.2278791', expected '11800189.2278791', error '0.0000000'

Test #3:

score: 15
Accepted
time: 43ms
memory: 318572kb

input:

100 99 50 79 14
1 2 10 29697 45013
3 2 11 58180 63946
2 4 10 70417 75332
3 5 13 12564 42521
3 6 12 1014 94538
7 6 19 31519 37381
8 2 19 43129 47092
6 9 11 11937 93000
10 2 19 1440 52945
10 11 15 51842 96769
12 10 12 13413 68632
5 13 11 2726 43016
4 14 10 40248 47577
5 15 10 60481 77412
10 16 14 5828...

output:

8097168.1290252041

result:

ok found '8097168.1290252', expected '8097168.1290252', error '0.0000000'

Test #4:

score: 15
Accepted
time: 63ms
memory: 318512kb

input:

100 99 50 29 68
2 1 17 66839 69114
3 1 12 62309 68062
4 1 13 62445 65101
5 1 18 8349 29514
6 5 17 5167 93696
7 3 17 15610 93975
8 6 19 12032 75118
7 9 10 15961 31054
4 10 17 40891 51887
11 2 17 18755 75848
12 5 13 13065 89120
13 5 14 48662 55669
14 8 18 9847 28102
2 15 18 76863 81427
16 8 14 32493 3...

output:

8400900.9472540487

result:

ok found '8400900.9472540', expected '8400900.9472541', error '0.0000000'

Subtask #2:

score: 10
Accepted

Test #5:

score: 10
Accepted
time: 99ms
memory: 318608kb

input:

100 400 1 3 100
10 1 13 18223 35112
1 2 12 55368 55369
11 2 17 26761 33328
10 11 16 32129 40781
3 12 11 54283 82995
19 20 14 61623 64279
4 13 19 68053 68404
28 29 12 51572 76296
5 14 17 60900 80188
37 38 19 4559 88722
6 15 18 70161 98792
46 66 18 31418 46063
7 16 12 59448 73370
74 75 16 61790 91015
...

output:

565023.0000000000

result:

ok found '565023.0000000', expected '565023.0000000', error '0.0000000'

Test #6:

score: 10
Accepted
time: 84ms
memory: 318716kb

input:

100 400 1 43 61
2 1 4 49747 72455
3 2 9 88598 94622
3 4 20 55578 68329
4 5 3 76244 80337
6 5 17 45788 51679
7 6 7 21521 59847
7 8 13 57753 65729
9 8 10 78127 95442
9 10 17 8181 50146
11 10 8 14043 35566
12 11 20 5050 25253
13 12 15 61543 96300
14 13 2 32429 54948
14 15 12 93689 99997
16 15 3 17968 4...

output:

295670.0000000000

result:

ok found '295670.0000000', expected '295670.0000000', error '0.0000000'

Subtask #3:

score: 15
Accepted

Dependency #2:

100%
Accepted

Test #7:

score: 15
Accepted
time: 819ms
memory: 318912kb

input:

1000 4000 1 851 829
32 1 18 10334 59149
2 1 17 42334 90414
2 33 10 24226 37837
33 32 12 13963 44622
3 34 17 12554 59801
64 63 11 33339 55475
35 4 15 26593 88751
94 95 10 31806 40083
5 36 12 1159 18345
126 125 11 29893 91393
37 6 15 9013 56562
157 156 12 5742 28609
38 7 18 29456 34325
187 188 19 3358...

output:

3040262.0000000000

result:

ok found '3040262.0000000', expected '3040262.0000000', error '0.0000000'

Test #8:

score: 15
Accepted
time: 764ms
memory: 319212kb

input:

800 4000 1 768 507
29 1 15 33191 46010
1 2 13 4678 63191
30 2 13 40409 90658
29 30 15 51433 69090
31 3 10 21936 96868
58 57 14 29518 80829
4 32 13 67117 79907
85 86 15 24145 98188
33 5 18 802 79736
113 114 20 20455 72496
34 6 15 49934 86035
141 142 13 55169 95675
7 35 20 49304 75881
170 169 11 1656 ...

output:

1252192.0000000000

result:

ok found '1252192.0000000', expected '1252192.0000000', error '0.0000000'

Test #9:

score: 15
Accepted
time: 322ms
memory: 318736kb

input:

1000 999 1 270 794
2 1 20 26017 100000
3 2 20 67920 100000
4 3 20 18660 100000
4 5 20 90882 100000
5 6 20 81270 100000
7 6 20 37164 100000
7 8 20 12522 100000
9 8 20 26819 100000
10 9 20 51100 100000
10 11 20 18243 100000
12 11 20 84082 100000
12 13 20 88885 100000
14 13 20 61329 100000
14 15 20 883...

output:

825513521.0000000000

result:

ok found '825513521.0000000', expected '825513521.0000000', error '0.0000000'

Test #10:

score: 15
Accepted
time: 733ms
memory: 318800kb

input:

999 4000 1 995 28
2 1 7 38082 64577
3 2 20 3836 76209
4 3 11 55617 99139
4 5 2 41943 67901
6 5 17 6533 91608
7 6 5 20242 37822
7 8 12 12101 33506
8 9 9 48606 51674
9 10 7 10350 21298
10 11 16 73130 78801
12 11 7 13735 70377
12 13 6 5219 49858
14 13 20 13661 97174
14 15 3 59599 97552
16 15 7 15381 32...

output:

15361348.0000000000

result:

ok found '15361348.0000000', expected '15361348.0000000', error '0.0000000'

Test #11:

score: 15
Accepted
time: 804ms
memory: 318768kb

input:

1000 3999 1 724 942
1 2 10 13276 90759
3 1 15 36756 37246
4 1 12 19810 91764
1 5 11 19547 94540
6 1 18 30494 38340
1 7 10 32085 33315
8 1 18 36147 38234
9 8 13 36111 38705
10 1 14 19505 97749
1 11 17 14211 92528
12 1 18 38035 39210
1 13 19 31296 36665
14 7 10 33315 38669
1 15 18 18143 96329
16 1 20 ...

output:

2048971.0000000000

result:

ok found '2048971.0000000', expected '2048971.0000000', error '0.0000000'

Test #12:

score: 15
Accepted
time: 846ms
memory: 318800kb

input:

1000 4000 1 39 718
2 949 16 16489 54653
3 876 16 51625 88422
518 4 19 29590 34707
703 5 12 47195 56129
6 389 17 25655 96606
161 7 10 55738 89149
8 274 18 27821 39449
230 9 14 44427 83590
606 10 18 52356 80814
11 930 16 80890 87440
548 12 11 47547 84315
13 283 14 7495 68176
14 271 10 31361 95309
15 8...

output:

807183.0000000000

result:

ok found '807183.0000000', expected '807183.0000000', error '0.0000000'

Test #13:

score: 15
Accepted
time: 801ms
memory: 318912kb

input:

1000 3999 1 505 274
1 2 18 8 90951
3 2 11 1 91691
4 3 6 6 93975
4 5 14 7 93742
6 5 17 10 98257
6 7 15 1 96571
8 7 3 4 99475
8 9 13 7 98715
10 9 14 1 93865
11 10 6 2 96162
12 11 9 3 96466
13 12 10 9 95393
13 14 11 4 95104
15 14 8 9 95141
15 16 6 5 92038
16 17 17 9 92480
17 18 17 4 96760
18 19 16 4 90...

output:

13559.0000000000

result:

ok found '13559.0000000', expected '13559.0000000', error '0.0000000'

Test #14:

score: 15
Accepted
time: 799ms
memory: 318792kb

input:

999 3999 1 30 760
1 2 8 7 97039
2 3 12 8 98879
4 3 4 4 90191
5 4 12 9 90428
5 6 16 1 98652
6 7 4 5 92196
7 8 2 3 92217
9 8 20 7 94675
10 9 4 4 95650
10 11 17 7 96221
11 12 1 1 91186
12 13 14 4 98705
14 13 4 1 97597
14 15 1 4 92300
15 16 16 8 90727
17 16 1 7 90217
17 18 7 6 92725
18 19 7 4 98033
20 1...

output:

172715.0000000000

result:

ok found '172715.0000000', expected '172715.0000000', error '0.0000000'

Test #15:

score: 15
Accepted
time: 796ms
memory: 318776kb

input:

1000 4000 1 317 271
1 2 9 5 93052
3 2 8 6 96771
3 4 3 8 96160
5 4 13 6 95453
5 6 14 6 94557
6 7 9 9 90953
8 7 17 8 92903
9 8 6 3 94104
9 10 12 8 96688
11 10 15 9 98608
11 12 13 5 93208
13 12 16 9 96348
14 13 3 6 98686
15 14 5 1 99177
15 16 2 10 96703
17 16 14 2 91541
18 17 14 1 92412
18 19 11 10 930...

output:

401591.0000000000

result:

ok found '401591.0000000', expected '401591.0000000', error '0.0000000'

Subtask #4:

score: 25
Accepted

Dependency #1:

100%
Accepted

Dependency #2:

100%
Accepted

Test #16:

score: 25
Accepted
time: 88ms
memory: 318600kb

input:

100 400 20 100 6
1 10 10 37861 50357
2 1 19 7830 74673
2 11 15 33326 69819
10 11 12 39344 85527
12 3 20 15784 55754
20 19 11 9872 21978
13 4 13 22401 43523
29 28 17 84903 88765
5 14 10 22745 42111
38 37 16 15008 26758
6 15 13 5270 49372
65 66 17 55158 78378
16 7 20 12236 70841
74 75 12 92834 99928
8...

output:

830382.6407766991

result:

ok found '830382.6407767', expected '830382.6407767', error '0.0000000'

Test #17:

score: 25
Accepted
time: 88ms
memory: 318676kb

input:

100 400 50 10 45
1 10 17 29451 97470
1 2 10 63349 72452
2 11 14 33309 76111
10 11 12 30976 88523
12 3 16 14864 48989
20 19 20 16901 38920
13 4 12 7712 71353
28 29 19 54313 55358
14 5 20 20325 25058
38 37 20 2537 70940
15 6 12 36876 83633
66 65 16 7022 21311
16 7 15 43978 77802
74 75 20 5297 80929
8 ...

output:

1870147.8310820728

result:

ok found '1870147.8310821', expected '1870147.8310821', error '0.0000000'

Test #18:

score: 25
Accepted
time: 80ms
memory: 318612kb

input:

100 400 50 45 36
2 1 17 2583 5228
3 2 2 9015 24523
3 4 6 40155 76911
5 4 19 65855 77215
5 6 18 2468 80202
6 7 12 33458 72325
8 7 11 33603 95807
9 8 3 29210 53612
10 9 4 31460 54746
10 11 11 43776 49774
12 11 4 85145 90080
12 13 8 46736 80445
14 13 14 54280 87183
15 14 20 5400 10347
15 16 4 28993 705...

output:

173526.4322234911

result:

ok found '173526.4322235', expected '173526.4322235', error '0.0000000'

Test #19:

score: 25
Accepted
time: 108ms
memory: 318620kb

input:

99 400 50 46 64
2 1 19 13089 92563
3 1 10 16869 92046
4 1 19 12704 91015
5 1 16 19003 95870
6 1 13 15774 91467
7 1 16 37876 39730
1 8 20 13681 92507
9 3 19 10619 95941
8 10 12 18843 94556
11 1 15 17935 91522
12 2 16 14554 91577
13 1 16 18816 94796
12 14 15 14831 90319
1 15 19 14791 97793
16 1 11 178...

output:

1421519.7702448210

result:

ok found '1421519.7702448', expected '1421519.7702448', error '0.0000000'

Test #20:

score: 25
Accepted
time: 87ms
memory: 318596kb

input:

100 399 49 2 35
77 2 11 39406 61475
3 62 14 86827 91338
84 4 10 52113 70666
5 59 17 13757 38998
24 6 16 75253 88768
84 7 14 5253 60755
1 8 17 15153 44899
9 98 17 14513 79392
1 10 19 31791 97272
1 11 13 49000 60720
53 12 16 72684 79365
78 13 14 62381 63614
14 20 19 45859 70469
9 15 19 10656 59249
16 ...

output:

86081.1946292190

result:

ok found '86081.1946292', expected '86081.1946292', error '0.0000000'

Test #21:

score: 25
Accepted
time: 87ms
memory: 318584kb

input:

100 399 49 12 41
2 1 13 3 94258
3 2 17 3 93831
3 4 4 1 99696
4 5 4 9 98307
5 6 19 4 92875
7 6 6 4 90021
8 7 19 3 98986
8 9 7 1 99168
10 9 7 9 98140
10 11 4 6 90202
12 11 3 8 92084
12 13 3 3 90802
13 14 17 9 93781
14 15 15 7 98251
15 16 3 6 99408
17 16 3 6 95934
17 18 4 1 91316
19 18 1 9 93281
19 20 ...

output:

137960.7133129337

result:

ok found '137960.7133129', expected '137960.7133129', error '0.0000000'

Test #22:

score: 25
Accepted
time: 95ms
memory: 318456kb

input:

100 400 49 67 42
2 1 9 10 92500
3 2 7 8 94006
3 4 14 6 99372
4 5 9 8 92282
5 6 1 6 93767
6 7 9 8 91829
8 7 7 1 92338
8 9 17 10 90987
10 9 10 9 97993
11 10 1 4 95291
12 11 1 3 99324
13 12 20 6 98346
13 14 2 4 92811
15 14 14 6 90258
16 15 8 6 99898
16 17 11 1 92890
17 18 14 3 90598
19 18 4 4 92228
20 ...

output:

82675.8454131201

result:

ok found '82675.8454131', expected '82675.8454131', error '0.0000000'

Test #23:

score: 25
Accepted
time: 94ms
memory: 318612kb

input:

100 399 50 86 21
2 1 14 2 95596
2 3 5 3 90038
3 4 2 5 91466
5 4 10 2 94957
6 5 3 7 96519
7 6 2 3 92328
7 8 10 7 90223
8 9 13 9 91236
9 10 17 1 92850
10 11 6 1 91936
11 12 17 2 95236
13 12 16 5 96486
13 14 9 3 96082
15 14 15 10 98857
15 16 1 7 99137
17 16 3 10 98794
18 17 3 10 95034
18 19 4 4 94929
2...

output:

52864.4308055356

result:

ok found '52864.4308055', expected '52864.4308055', error '0.0000000'

Test #24:

score: 25
Accepted
time: 96ms
memory: 318696kb

input:

100 400 50 64 76
2 1 4 8 95153
3 2 2 4 93276
4 3 6 4 93115
5 4 8 3 92039
5 6 14 8 92164
7 6 13 2 92054
7 8 9 3 90420
8 9 10 10 97740
9 10 3 5 98529
11 10 13 9 90557
12 11 20 10 97608
12 13 12 5 95010
14 13 14 2 99355
15 14 12 7 92489
16 15 7 3 99690
16 17 17 7 98336
18 17 17 3 94557
18 19 14 1 94166...

output:

19515.0000000000

result:

ok found '19515.0000000', expected '19515.0000000', error '0.0000000'

Subtask #5:

score: 35
Accepted

Dependency #1:

100%
Accepted

Dependency #2:

100%
Accepted

Dependency #3:

100%
Accepted

Dependency #4:

100%
Accepted

Test #25:

score: 35
Accepted
time: 819ms
memory: 318780kb

input:

1000 4000 1000 616 536
1 2 20 5156 45083
3 2 20 15778 26174
3 4 20 65638 78088
5 4 20 5197 41363
5 6 20 28519 78439
7 6 20 3970 89814
8 7 20 3011 72095
8 9 20 58295 79730
9 10 20 33028 93193
11 10 20 56025 71133
12 11 20 7234 93851
13 12 20 23692 55866
14 13 20 3764 22036
14 15 20 22688 38980
16 15 ...

output:

112644.7212732783

result:

ok found '112644.7212733', expected '112644.7212733', error '0.0000000'

Test #26:

score: 35
Accepted
time: 818ms
memory: 318748kb

input:

1000 4000 1000 488 465
1 2 20 73927 97108
2 3 20 18066 74540
4 3 20 30432 43484
4 5 20 49119 98022
5 6 20 53368 97534
6 7 20 31440 38457
8 7 20 21128 34050
9 8 20 36163 52697
9 10 20 26617 29222
11 10 20 3847 47582
12 11 20 27116 70352
13 12 20 45068 89753
14 13 20 13535 75688
15 14 20 5387 15613
15...

output:

533524.0358424314

result:

ok found '533524.0358424', expected '533524.0358424', error '0.0000000'

Test #27:

score: 35
Accepted
time: 804ms
memory: 318936kb

input:

1000 4000 30 513 364
1 32 14 2781 13058
2 1 10 51720 76345
33 2 17 61784 84790
33 32 11 64852 65942
3 34 12 30013 76147
64 63 15 23404 57417
35 4 14 38950 65657
94 95 18 8834 86906
5 36 13 25142 32080
125 126 15 36346 92933
37 6 18 31921 59645
157 156 12 54991 92805
7 38 12 52473 71379
187 188 14 19...

output:

1607511.6428672820

result:

ok found '1607511.6428673', expected '1607511.6428673', error '0.0000000'

Test #28:

score: 35
Accepted
time: 807ms
memory: 318832kb

input:

1000 4000 1000 894 326
32 1 18 3705 40631
1 2 20 33198 50317
33 2 20 34941 36451
33 32 20 40673 73019
34 3 15 63359 79209
64 63 18 6687 43815
35 4 12 51904 67587
94 95 12 5492 54783
5 36 17 24659 79138
126 125 16 59638 82799
37 6 14 15622 91642
156 157 13 52737 88967
38 7 12 12449 75426
188 187 14 2...

output:

794162.8076138269

result:

ok found '794162.8076138', expected '794162.8076138', error '0.0000000'

Test #29:

score: 35
Accepted
time: 334ms
memory: 318736kb

input:

1000 999 1000 498 72
1 2 20 19450 100000
2 3 20 38499 100000
4 3 20 79106 100000
5 4 20 85709 100000
6 5 20 91923 100000
6 7 20 53214 100000
7 8 20 92200 100000
9 8 20 94138 100000
10 9 20 93307 100000
11 10 20 41622 100000
12 11 20 93475 100000
13 12 20 39771 100000
13 14 20 21285 100000
14 15 20 9...

output:

608553250.7785319090

result:

ok found '608553250.7785319', expected '608553250.7785321', error '0.0000000'

Test #30:

score: 35
Accepted
time: 740ms
memory: 318632kb

input:

1000 4000 1000 833 28
1 2 15 13360 87150
2 3 14 46441 62487
3 4 14 17171 96137
5 4 11 34818 45047
5 6 8 50528 94542
7 6 14 66731 82882
8 7 16 10304 27070
8 9 1 57101 72657
9 10 18 29859 39310
11 10 6 4100 65767
11 12 11 36148 96806
12 13 16 1214 15652
14 13 10 58466 86638
14 15 12 31200 94679
16 15 ...

output:

12940885.0809919

result:

ok found '12940885.0809919', expected '12940885.0809919', error '0.0000000'

Test #31:

score: 35
Accepted
time: 764ms
memory: 318848kb

input:

1000 4000 1000 126 236
1 2 13 51848 99065
3 2 8 8991 83975
3 4 16 1423 91067
4 5 2 34374 47409
6 5 7 694 85559
7 6 12 24184 82016
7 8 12 6178 73976
8 9 3 79601 88090
10 9 7 53636 94870
11 10 4 49086 73426
12 11 18 38525 65331
12 13 4 59686 99217
13 14 15 62591 64420
14 15 3 3146 60636
16 15 1 14237 ...

output:

1323975.2146063731

result:

ok found '1323975.2146064', expected '1323975.2146064', error '0.0000000'

Test #32:

score: 35
Accepted
time: 835ms
memory: 318864kb

input:

1000 4000 1000 995 319
1 2 18 30564 33080
1 3 10 12694 98320
1 4 10 32490 34348
5 1 11 32632 34934
6 1 17 10983 94796
6 7 11 19591 94682
1 8 13 36511 36980
9 1 12 13904 91544
1 10 20 33168 38349
11 1 20 14985 94966
12 1 12 18803 92678
13 8 19 30713 39198
14 12 10 18237 95566
13 15 19 34270 35331
1 1...

output:

1090440.4960698795

result:

ok found '1090440.4960699', expected '1090440.4960699', error '0.0000000'

Test #33:

score: 35
Accepted
time: 785ms
memory: 318828kb

input:

1000 4000 1000 901 1000
1 2 18 16678 90983
3 1 12 33018 36170
4 1 14 30721 35046
1 5 12 30462 32083
6 4 13 32225 33171
2 7 17 18570 94767
1 8 13 19361 94437
9 1 13 14714 94744
10 8 14 16953 92274
11 1 17 12638 92383
4 12 20 31836 32634
1 13 17 36012 37254
1 14 18 12452 97688
3 15 12 31168 34052
1 16...

output:

306493.6806217690

result:

ok found '306493.6806218', expected '306493.6806218', error '0.0000000'

Test #34:

score: 35
Accepted
time: 821ms
memory: 318976kb

input:

1000 4000 1000 49 558
784 2 19 267 18417
502 3 17 37405 63729
152 4 16 9273 14596
5 768 12 77233 78941
6 947 16 28353 96675
255 7 18 8741 47682
8 429 14 31956 93359
585 9 18 23579 86671
472 10 19 69268 70388
11 953 15 30918 42300
12 448 10 32711 45629
13 53 15 48198 74507
351 14 13 44705 50243
15 23...

output:

3387888.4101048168

result:

ok found '3387888.4101048', expected '3387888.4101048', error '0.0000000'

Test #35:

score: 35
Accepted
time: 832ms
memory: 318900kb

input:

1000 4000 1000 158 410
2 695 15 22430 94740
3 163 16 25175 44196
24 4 17 60098 97740
945 5 11 42768 64912
619 6 15 84663 99567
7 582 20 18316 41309
8 775 14 40325 66769
236 9 11 71583 77549
10 218 17 26059 52201
11 531 14 61053 62776
683 12 10 3320 15753
13 563 10 3119 38873
14 170 17 68126 77614
18...

output:

2326748.5420886627

result:

ok found '2326748.5420887', expected '2326748.5420887', error '0.0000000'

Test #36:

score: 35
Accepted
time: 812ms
memory: 319000kb

input:

1000 4000 1000 307 35
1 2 11 5 96362
3 2 4 5 90176
3 4 9 9 90402
5 4 10 2 96890
5 6 8 6 93015
7 6 14 2 97805
8 7 3 2 99538
8 9 1 1 94371
10 9 6 9 90212
11 10 8 10 92020
11 12 9 10 94421
13 12 16 9 97765
13 14 18 9 97383
15 14 7 6 99858
15 16 18 8 92149
16 17 18 5 93369
17 18 10 2 91725
19 18 18 2 96...

output:

229666.9149457732

result:

ok found '229666.9149458', expected '229666.9149458', error '0.0000000'

Test #37:

score: 35
Accepted
time: 802ms
memory: 318764kb

input:

1000 4000 1000 358 329
1 2 3 8 97253
3 2 7 9 98269
4 3 7 10 90922
5 4 8 1 95379
6 5 15 6 91017
6 7 11 3 91985
7 8 2 1 90992
9 8 7 3 95036
10 9 20 3 93290
10 11 8 9 90724
12 11 19 1 95830
13 12 14 9 92434
13 14 4 5 94152
15 14 2 7 94824
16 15 4 2 93040
17 16 17 3 99286
17 18 18 3 96541
18 19 7 6 9228...

output:

78913.2798072295

result:

ok found '78913.2798072', expected '78913.2798072', error '0.0000000'

Test #38:

score: 35
Accepted
time: 809ms
memory: 319324kb

input:

1000 4000 1000 701 433
2 1 20 5 90063
3 2 5 3 90488
4 3 17 7 93906
4 5 20 7 98880
5 6 12 8 90587
6 7 8 9 90391
8 7 13 1 91167
8 9 18 8 99906
10 9 16 10 95694
10 11 19 10 90268
12 11 17 9 92592
12 13 1 7 98927
13 14 5 9 95310
14 15 5 10 91722
15 16 7 8 96143
16 17 7 1 94390
18 17 10 6 94836
18 19 17 ...

output:

116304.7159166994

result:

ok found '116304.7159167', expected '116304.7159167', error '0.0000000'

Test #39:

score: 35
Accepted
time: 813ms
memory: 319488kb

input:

1000 4000 1000 987 16
1 2 11 2 92338
3 2 2 4 95583
4 3 7 2 99465
4 5 9 5 99647
6 5 18 8 95078
7 6 12 9 96362
8 7 12 6 96755
8 9 16 9 94994
10 9 20 2 92472
10 11 15 3 94369
11 12 8 9 96079
13 12 2 9 91216
14 13 14 2 99847
14 15 1 3 98947
15 16 17 10 94333
17 16 14 9 97683
18 17 3 7 98507
18 19 7 4 99...

output:

104748.0991412273

result:

ok found '104748.0991412', expected '104748.0991412', error '0.0000000'