QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#502098#9156. 百万富翁hypeskynick#Compile Error//C++14632b2024-08-03 00:58:372024-08-03 00:58:42

Judging History

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

  • [2024-08-03 00:58:42]
  • 评测
  • [2024-08-03 00:58:37]
  • 提交

answer

// Source: https://usaco.guide/general/io

#include <bits/stdc++.h>
#include "richest.h"
using namespace std;
int solveSmall(int n,int s){//task 1 is just a n^2 brute force
//simmilar to first explore task
//surely
	vector<int> x,y;
	for(int i=0;i<n;i++){
		for(int j=i+1;j<n;j++){
			x.emplace_push_back(i),y.emplace_push_back(j);
		}
	}
	vector<int> z=ask(x,y),cnt(n);//ask-2005 refrence 0-0
	for(int i=0;i<n;i++){
		cnt[z[i]]++;
	}
	return *max_element(cnt.begin(),cnt.end());
}
int solveLarge(int n,int s){

}
int richest(int n, int t,int s){
	if(t==1)return solveSmall(n,s);
	return solveLarge(n,s);
}

详细

answer.code: In function ‘int solveSmall(int, int)’:
answer.code:12:27: error: ‘class std::vector<int>’ has no member named ‘emplace_push_back’; did you mean ‘emplace_back’?
   12 |                         x.emplace_push_back(i),y.emplace_push_back(j);
      |                           ^~~~~~~~~~~~~~~~~
      |                           emplace_back
answer.code:12:50: error: ‘class std::vector<int>’ has no member named ‘emplace_push_back’; did you mean ‘emplace_back’?
   12 |                         x.emplace_push_back(i),y.emplace_push_back(j);
      |                                                  ^~~~~~~~~~~~~~~~~
      |                                                  emplace_back
answer.code: In function ‘int solveLarge(int, int)’:
answer.code:23:1: warning: no return statement in function returning non-void [-Wreturn-type]
   23 | }
      | ^