QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#498229#9156. 百万富翁biuld#15 613ms29132kbC++14747b2024-07-30 09:29:022024-07-30 09:29:03

Judging History

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

  • [2024-07-30 09:29:03]
  • 评测
  • 测评结果:15
  • 用时:613ms
  • 内存:29132kb
  • [2024-07-30 09:29:02]
  • 提交

answer

#include "richest.h"
#include<bits/stdc++.h>
using namespace std;
const int N = 1e3;

vector<int> a, b, c;
int w[N + 5][N + 5];

int richest(int n, int t, int s){
	if(t == 1){
		a.clear();
		b.clear();
		for(int i = 0; i < n; ++ i){
			for(int j = i + 1; j < n; ++ j){
				a.push_back(i);
				b.push_back(j);
			}
		}
		c = ask(a, b);
		for(int i = 0; i < a.size(); ++ i){
			w[a[i]][b[i]] = w[b[i]][a[i]] = c[i];
			// cout << a[i] << ' ' << b[i] << ": " << c[i] << '\n';
			// cout << w[a[i]][b[i]] << '\n';
		}
		int now = 0;
		for(int i = 1; i < n; ++ i){
			// cout << now << '-' << i << ':' << w[now][i] << '\n';
			if(w[now][i] == i) now = i;
		}
		// cout << now << '\n';
		return now;
	}
    return 1;
}

详细


Pretests

Pretest #1:

score: 15
Accepted
time: 598ms
memory: 29132kb

input:

1000 1 499500 957319859

output:

Correct
7127326332295218295
1.000000
1331569654267968081

result:

points 1.0 Correct

Pretest #2:

score: 0
Wrong Answer
time: 17ms
memory: 25384kb

input:

1000000 20 2000000 29091473

output:

Wrong answer
4459638610240858557
0.000000
6906350380861515327

result:

points 0.0 Wrong answer


Final Tests

Test #1:

score: 15
Accepted
time: 613ms
memory: 27840kb

input:

1000 1 499500 957319857

output:

Correct
7127326332295218295
1.000000
1331569654267968081

result:

points 1.0 Correct

Test #2:

score: 0
Wrong Answer
time: 13ms
memory: 25228kb

input:

1000000 20 2000000 29091471

output:

Wrong answer
4459638610240858557
0.000000
6906350380861515327

result:

points 0.0 Wrong answer