Submission #585820

#TimeUsernameProblemLanguageResultExecution timeMemory
585820Koosha_mvCombo (IOI18_combo)C++14
5 / 100
1 ms208 KiB
#include "combo.h" #include <bits/stdc++.h> using namespace std; #define dbgv(v) cout<<#v<<" = "; f(i,0,v.size()) cout<<v[i]<<" "; cout<<endl #define dbga(a,x,y) cout<<#a<<" = "; f(i,x,y) cout<<a[i]<<" "; cout<<endl #define erorp(x) cout<<#x<<"={"<<x.F<<" , "<<x.S<<"}"<<endl #define eror(x) cout<<#x<<'='<<(x)<<endl #define f_(i,a,b) for(int i=a;i>=b;i--) #define f(i,a,b) for(int i=a;i<b;i++) #define nb(x) __builtin_popcount(x) #define all(v) v.begin(),v.end() #define bit(n,k) (((n)>>(k))&1) #define Add(x,y) x=(x+y)%mod #define maxm(a,b) a=max(a,b) #define minm(a,b) a=min(a,b) #define lst(x) x[x.size()-1] #define sz(x) int(x.size()) #define mp make_pair #define ll long long #define pb push_back #define S second #define F first int n; string s; vector<char> chr; string guess_sequence(int _n) { string ans; n=_n; chr.pb('X'),chr.pb('Y'),chr.pb('A'),chr.pb('B'); f(i,0,3){ string p; p+=chr[i]; if(press(p)>0){ ans+=chr[i]; chr.erase(chr.begin()+i); break; } } if(ans.size()==0) ans+=chr.back(),chr.pop_back(); f(i,1,n-1){ string p=ans+chr[1]; f(j,0,3) p=p+ans+chr[2]+chr[j]; if(p.size()>4*n) eror("FUCK"); int coins=press(p); ans+=chr[coins-i]; } if(press(ans+chr[0])==n) ans+=chr[0]; else if(press(ans+chr[1])==n) ans+=chr[1]; else ans+=chr[2]; return ans; }

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:45:16: warning: comparison of integer expressions of different signedness: 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   45 |     if(p.size()>4*n) eror("FUCK");
      |        ~~~~~~~~^~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...