QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#570232#9308. World CupAceTaffy258Compile Error//C++20416b2024-09-17 14:52:042024-09-17 14:52:07

Judging History

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

  • [2024-09-17 14:52:07]
  • 评测
  • [2024-09-17 14:52:04]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;

int a[40];
bool cmp(int x,int y){
	return x>y;
}
int main(){
	std::ios::sync_with_stdio(0);
	cin.tie(0),cout.tie(0);
	int T;cin>>T;
	while(T--){
		for(int i=1;i<=32;i++){
			cin>>a[i];
		}
		int chn=a[1];
		sort(a+1,a+33,cmp);
		int ans=1;
		for(int i=1;i<=32;i*=2){
			if(ch>=a[i]){
				ans=i;break;
			}
		}
		cout<<ans<<endl;
	}
	return 0;
}

Details

answer.code: In function ‘int main()’:
answer.code:20:28: error: ‘ch’ was not declared in this scope; did you mean ‘chn’?
   20 |                         if(ch>=a[i]){
      |                            ^~
      |                            chn