제출 #1146900

#제출 시각아이디문제언어결과실행 시간메모리
1146900emptypringlescanPassword (RMI18_password)C++20
컴파일 에러
0 ms0 KiB
vector<int> ans;
pair<int,int> num[26];
string guess(int n, int s){
	string tst;
	for(int i=0; i<s; i++){
		tst="";
		for(int j=0; j<n; j++){
			tst+=(char)('a'+i);
		}
		num[i]={query(tst),i};
	}
	sort(num,num+s,greater<pair<int,int> >());
	for(int i=0; i<s; i++){
		int chr=num[i].second,nom=num[i].first;
		if(true){
			int aft=0;
			for(int k=0; k<nom; k++){
				aft=0;
				for(int j=0; j<i; j++){
					tst="";
					for(int a=0; a<=k; a++) tst+=(char)('a'+chr);
					for(int a=k+1; a<n; a++) tst+=(char)('a'+num[j].second);
					aft+=query(tst)-k-1;
				}
				ans.insert(ans.end()-aft,chr);
			}
		}
		else{
			
		}
	}
	tst="";
	for(int i=0; i<n; i++) tst+=(char)('a'+ans[i]);
	return tst;
}

컴파일 시 표준 에러 (stderr) 메시지

password.cpp:1:1: error: 'vector' does not name a type
    1 | vector<int> ans;
      | ^~~~~~
password.cpp:2:1: error: 'pair' does not name a type
    2 | pair<int,int> num[26];
      | ^~~~
password.cpp:3:1: error: 'string' does not name a type
    3 | string guess(int n, int s){
      | ^~~~~~