QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#507050#9156. 百万富翁juruoA#0 62ms30304kbC++141.8kb2024-08-06 09:33:462024-08-06 09:33:46

Judging History

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

  • [2024-08-06 09:33:46]
  • 评测
  • 测评结果:0
  • 用时:62ms
  • 内存:30304kb
  • [2024-08-06 09:33:46]
  • 提交

answer

#include <bits/stdc++.h>
#include "richest.h"
using std::bitset;
using std::cout;
using std::deque;
using std::endl;
using std::greater;
using std::lower_bound;
using std::make_pair;
using std::map;
using std::max;
using std::min;
using std::multimap;
using std::multiset;
using std::nth_element;
using std::pair;
using std::priority_queue;
using std::queue;
using std::reverse; 
using std::set;
using std::sort;
using std::sqrt;
using std::stable_sort;
using std::string;
using std::swap;
using std::unique;
using std::upper_bound;
using std::vector;
typedef int li;
typedef long double lf;

inline li read(){
	li ans = 0, f = 1;
	char ch = getchar();
	while(ch < '0' || ch > '9'){
		f = (ch == '-') ? -1 : 1;
		ch = getchar();
	}
	while(ch <= '9' && ch >= '0'){
		ans = ans * 10 + (ch ^ 48);
		ch = getchar();
	}
	return ans * f;
} 

vector<int> v1, v2, v3;
li a[2010][2010];

int richest(li n, li t, li s){
//	FILE *out = fopen("www.ww", "a");
//	cout << n << " " << t << " " << s << endl;
	if(t == 1){
		for(li i = 1; i <= n; i++){
			for(li j = i + 1; j <= n; j++){
				v1.push_back(i - 1);
				v2.push_back(j - 1);
			}
		}
		v3 = ask(v1, v2);
		li now = 0;
		for(li i = 1; i <= n; i++){
			for(li j = i + 1; j <= n; j++){
				if(v3[now] + 1 == i) a[i][j] = 1;
				else a[i][j] = 0;
				a[j][i] = !a[i][j];
//				fprintf(out, "%d %d %d %d\n", v1[now], v2[now], v3[now] + 1, a[i][j]);
				now++;
			}
			a[i][i] = 1;
		}
		for(li i = 1; i <= n; i++){
			li cnt = 0;
			for(li j = 1; j <= n; ++j) cnt += a[i][j];
//			fprintf(out, "cnt %d = %d\n", i, cnt);
			if(cnt == n){
//				fclose(out);
				return i;
			}
		}
	}
	return 1;
}

//int main(){
//	// freopen("wonderful.ans", "r", stdin);
//	// freopen("www.ww", "w", stdout); 
//	
//	return 0;
//} 

详细


Pretests

Pretest #1:

score: 0
Wrong Answer
time: 56ms
memory: 30248kb

input:

1000 1 499500 957319859

output:

Wrong answer
4459638610240858557
0.000000
6906350380861515327

result:

points 0.0 Wrong answer

Pretest #2:

score: 0
Wrong Answer
time: 10ms
memory: 24960kb

input:

1000000 20 2000000 29091473

output:

Wrong answer
4459638610240858557
0.000000
6906350380861515327

result:

points 0.0 Wrong answer


Final Tests

Test #1:

score: 0
Wrong Answer
time: 62ms
memory: 30304kb

input:

1000 1 499500 957319857

output:

Wrong answer
4459638610240858557
0.000000
6906350380861515327

result:

points 0.0 Wrong answer

Test #2:

score: 0
Wrong Answer
time: 10ms
memory: 24992kb

input:

1000000 20 2000000 29091471

output:

Wrong answer
4459638610240858557
0.000000
6906350380861515327

result:

points 0.0 Wrong answer