QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#789000#9749. 小凯的省奖之梦isWFnoyaCompile Error//C++202.3kb2024-11-27 19:00:282024-11-27 19:00:29

Judging History

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

  • [2024-11-27 19:00:29]
  • 评测
  • [2024-11-27 19:00:28]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> PII;
const int N=1e6+10,mod=1e9+7;
char s[N];
int n,m,p,q;
typedef struct{
	string name;
	int zy1,dy1,ty1,zy2,dy2,ty2,zc1,zc2;
	int jx;
}Node;

bool cmp(Node &nd1,Node &nd2){
	if(nd1.jx!=nd2.jx) return nd1.jx>nd2.jx;
	if(nd1.zc1+nd1.zc2!=nd2.zc1+nd2.zc2) return nd1.zc1+nd1.zc2>nd2.zc1+nd2.zc2;
	if(nd1.zy1+nd1.zy2!=nd2.zy1+nd2.zy2) return nd1.zy1+nd1.zy2>nd2.zy1+nd2.zy2;
	return nd1.name>nd2.name;
}

bool cmp2(Node &nd1,Node &nd2){
	if(nd1.zc1!=nd2.zc1) return nd1.zc1>nd2.zc1;
	return nd1.name>nd2.name;
}
bool cmp3(Node &nd1,Node &nd2){
	if(nd1.zc2!=nd2.zc2) return nd1.zc2>nd2.zc2;
	return nd1.name>nd2.name;
}
Node e1[N],e2[N];

int cnt1,cnt2,cnt3;


bool check(){
	int c1=cnt1,c2=cnt2,c3=cnt3;
	for(int i=1;i<=n;i++) e2[i]=e1[i];
	for(int i=1;i<=n;i++){
		e2[i].zc1=e2[i].zy1+e2[i].dy1+e2[i].ty1;
		e2[i].zc2=e2[i].zy2+e2[i].dy2+e2[i].ty2;
	}
	sort(e2+1,e2+1+n,cmp2);
	for(int i=1;i<=n;i++){
		int res=1;
		for(int j=1;j<=n;j++){
			if(e[j].zy1>e[i].zy1) res++;
		}
		if(c1!=0&&res<floor(0.25*res)){
			c1--;
			e2[i].jx+=15;
		}else if(c2!=0&&res<floor(0.45*res)){
			c2--;
			e2[i].jx+=10;
		}else if(c3!=0&&res<floor(0.75*res)){
			c3--;
			e2[i].jx+=5;
		}
	}
	

	sort(e2+1,e2+1+n,cmp3);
for(int i=1;i<=n;i++){
		int res=1;
		for(int j=1;j<=n;j++){
			if(e[j].zy1>e[i].zy1) res++;
		}
		if(c1!=0&&res<floor(0.25*res)){
			c1--;
			e2[i].jx+=15;
		}else if(c2!=0&&res<floor(0.45*res)){
			c2--;
			e2[i].jx+=10;
		}else if(c3!=0&&res<floor(0.75*res)){
			c3--;
			e2[i].jx+=5;
		}
	}
	
	sort(e2+1,e2+1+n,cmp);
	for(int i=1;i<=m;i++){
		if(e2[i].name="crazyzhk") return true;
	}
	return false;
	
}

void __(){
	cin>>n;
	int id=0;
	for(int i=1;i<=n;i++){
		string s;
		int a,b,c,d,e,f;
		cin>>s>>a>>b>>c>>d>>e>>f;
		e1[i]={s,a,b,c,d,e,f};
		if(s=="crazyzhk") id=i;
	}
	cnt1=floor(0.15*n);
	cnt2=floor(0.25*n);
	cnt3=floor(0.35*n);
	cin>>m>>p>>q;
	int ans=1e9;
	int mx1=e[id].zy1,mx2=e[id].zy2;
	for(int i=0;i<=100-mx1;i++){
		for(int j=0;j<=100-mx2;j++){
			e[id].zy1=mx1+i,e[id].zy2=mx2+i;
			if(check()) ans=min(ans,p*i+q*j);
		}
	}
	if(ans>1e8) cout<<"Surely next time"<<endl;
	else cout<<ans<<endl;
	
}


int main(){
	
    int _=1;
    // cin>>_;
    while(_--){
        __();
    }
}

Details

answer.code: In function ‘bool check()’:
answer.code:45:28: error: ‘e’ was not declared in this scope; did you mean ‘std::numbers::e’?
   45 |                         if(e[j].zy1>e[i].zy1) res++;
      |                            ^
      |                            std::numbers::e
In file included from /usr/include/c++/13/bits/max_size_type.h:37,
                 from /usr/include/c++/13/bits/ranges_base.h:39,
                 from /usr/include/c++/13/bits/ranges_algobase.h:38,
                 from /usr/include/c++/13/bits/ranges_algo.h:38,
                 from /usr/include/c++/13/algorithm:63,
                 from /usr/include/x86_64-linux-gnu/c++/13/bits/stdc++.h:51,
                 from answer.code:1:
/usr/include/c++/13/numbers:122:27: note: ‘std::numbers::e’ declared here
  122 |   inline constexpr double e = e_v<double>;
      |                           ^
answer.code:64:28: error: ‘e’ was not declared in this scope; did you mean ‘std::numbers::e’?
   64 |                         if(e[j].zy1>e[i].zy1) res++;
      |                            ^
      |                            std::numbers::e
/usr/include/c++/13/numbers:122:27: note: ‘std::numbers::e’ declared here
  122 |   inline constexpr double e = e_v<double>;
      |                           ^
answer.code:80:30: error: could not convert ‘e2[i].Node::name.std::__cxx11::basic_string<char>::operator=(((const char*)"crazyzhk"))’ from ‘std::__cxx11::basic_string<char>’ to ‘bool’
   80 |                 if(e2[i].name="crazyzhk") return true;
      |                    ~~~~~~~~~~^~~~~~~~~~~
      |                              |
      |                              std::__cxx11::basic_string<char>
answer.code: In function ‘void __()’:
answer.code:101:17: error: ‘e’ was not declared in this scope; did you mean ‘std::numbers::e’?
  101 |         int mx1=e[id].zy1,mx2=e[id].zy2;
      |                 ^
      |                 std::numbers::e
/usr/include/c++/13/numbers:122:27: note: ‘std::numbers::e’ declared here
  122 |   inline constexpr double e = e_v<double>;
      |                           ^
answer.code:103:36: error: ‘mx2’ was not declared in this scope; did you mean ‘mx1’?
  103 |                 for(int j=0;j<=100-mx2;j++){
      |                                    ^~~
      |                                    mx1