QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#749899#8363. interactivexcc_szy09050 5ms3980kbC++14831b2024-11-15 11:13:242024-11-15 11:13:27

Judging History

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

  • [2024-11-15 11:13:27]
  • 评测
  • 测评结果:0
  • 用时:5ms
  • 内存:3980kb
  • [2024-11-15 11:13:24]
  • 提交

answer

#include<bits/stdc++.h>
#include "interactive.h"
using namespace std;
const int kmaxn=505;
vector<int>an;
int dm[kmaxn][kmaxn];
int n;
void dfs(int x,int f){
	an.push_back(x);
	for(int i=1;i<=n;i++){
		if(dm[x][i]&&i!=f&&i!=x){
			dfs(i,x);
		}
	}
} 
std::vector<int> solve(int N){
	n=N;
	srand(time(0));
	for(int i=1;i<=n;i++){
		for(int j=1;j<=n;j++){
			dm[i][j]=100;
		}
	}
	vector<int>pr;
	for(int i=1;i<=n;i++){
		pr.push_back(i);
	}
	for(int I=1;I<=14000;I++){
		random_shuffle(pr.begin(),pr.end());
		int op=query(pr);
		for(int i=0;i<n-1;i++){
			int u=pr[i],v=pr[i+1];
			dm[u][v]=min(dm[u][v],op);
			dm[v][u]=min(dm[v][u],op);
		}
	}
	for(int i=1;i<=n;i++){
		int sz=0;
		for(int j=1;j<=n;j++){
			if(i!=j&&dm[i][j])sz++;
		}
		if(sz==1){dfs(i,0);return an;}
	}
	return an;
}

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 0
Wrong Answer

Test #1:

score: 0
Wrong Answer
time: 1ms
memory: 3852kb

input:

1 3
3 1 2

output:

0 0 0

result:

FAIL WA

Subtask #2:

score: 0
Memory Limit Exceeded

Test #11:

score: 90
Accepted
time: 2ms
memory: 3904kb

input:

1 27
17 16 3 20 27 5 2 13 24 21 25 23 19 9 7 4 22 12 26 15 14 11 1 18 6 10 8

output:

14000 661527752 558749364

result:

points 1.0

Test #12:

score: 90
Accepted
time: 5ms
memory: 3980kb

input:

1 29
19 13 20 22 26 1 23 24 3 14 8 25 29 17 10 9 15 11 18 4 2 28 21 7 6 12 16 27 5

output:

14000 661527752 145445666

result:

points 1.0

Test #13:

score: 90
Accepted
time: 5ms
memory: 3976kb

input:

1 28
16 7 19 9 23 12 20 26 4 10 15 8 21 5 1 22 27 2 18 24 28 6 3 14 13 17 25 11

output:

14000 661527752 877668399

result:

points 1.0

Test #14:

score: 90
Accepted
time: 5ms
memory: 3912kb

input:

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

output:

14000 661527752 737974315

result:

points 1.0

Test #15:

score: 90
Accepted
time: 5ms
memory: 3952kb

input:

1 27
18 25 15 20 23 14 4 16 27 6 2 12 21 19 17 26 9 8 10 11 3 7 13 22 24 5 1

output:

14000 661527752 590934171

result:

points 1.0

Test #16:

score: 0
Memory Limit Exceeded

input:

2 494
364 164 445 359 288 412 15 377 91 481 14 3 357 358 269 136 336 106 392 200 50 388 33 338 114 11 266 186 170 239 494 196 395 68 36 423 378 218 342 275 67 240 120 86 134 356 190 323 123 339 187 30 270 430 292 121 372 404 94 143 454 309 461 344 141 480 474 248 199 42 150 260 369 483 493 124 396 4...

output:

Unauthorized output

result: