Submission #464408

# Submission time Handle Problem Language Result Execution time Memory
464408 2021-08-13T07:04:33 Z fuad27 Password (RMI18_password) C++14
Compilation error
0 ms 0 KB
#include<bits/stdc++.h>
#include"grader.cpp"
using namespace std;
typedef long long ll;
typedef long double ld;
#define vii vector<pair<int, int>>
#define vi vector<int>
#define vl vector<long long>
#define vll vector<pair<long long, long long>>
#define mp make_pair
#define pb push_back
#define rep(i, a, b) for(int i = a;i<=b;i++)
#define f first
#define s second
#define FIO ios_base::sync_with_stdio(0);cin.tie(0);
#define start int tt;cin>>tt;rep(testcase, 1, tt)
#define print(k) cout<<"Case #"<<testcase<<": "<<k<<"\n";
#define endl "\n"
int query(string s);
string guess(int n, int s) {
	string ans = "";
	rep(i, 1, n)ans+="a";
	int pref = 0;
	bool check = false;
	rep(i, pref, n) {
		for(char c = 'a';c<'a' + s;c++) {
			ans[i] = c;
			int g = query(ans);
			if(g >= i + 1) {
				check = true;
				pref = g;
				break;
			}
		}
	}
	return ans;
}

Compilation message

password.cpp: In function 'std::string guess(int, int)':
password.cpp:24:7: warning: variable 'check' set but not used [-Wunused-but-set-variable]
   24 |  bool check = false;
      |       ^~~~~
/usr/bin/ld: /tmp/ccTZYuAB.o: in function `query(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)':
grader.cpp:(.text+0x80): multiple definition of `query(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)'; /tmp/cc6gfwFA.o:password.cpp:(.text+0x80): first defined here
/usr/bin/ld: /tmp/ccTZYuAB.o: in function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/cc6gfwFA.o:password.cpp:(.text.startup+0x0): first defined here
collect2: error: ld returned 1 exit status