Submission #155553

#TimeUsernameProblemLanguageResultExecution timeMemory
155553Sarah_MokhtarCombo (IOI18_combo)C++14
Compilation error
0 ms0 KiB
/*YOU CAN DO IT*/ #include <bits/stdc++.h> #include "combo.h" using namespace std; typedef long long ll; const int N=125252,M=101,OO=0x3f3f3f3f,mod=1e9+7; #define scan(A, n) for (int i=0;i<n;++i) cin>>A[i]; #define pb push_back #define bg begin #define des(A,n) sort(A,A+n);reverse(A,A+n) #define en end #define f first #define bs binary_search #define fill2(A, x) for(int i=0;i<N;++i) for(int j=0;j<N;++j) A[i][j]=x; #define set2(A, x) fill(A,A+N,x); #define scan2(A, n, m) for(int i=0;i<n;++i) for(int j=0;j<m;++j) cin >> A[i][j]; #define set(A, x) memset(A, x, sizeof(A)) #define print(A, x) for (int i=0;i<x;++i) cout<<A[i]<< " "; #define pii pair<int, int> #define pll pair<ll, ll> #define low lower_bound #define high upper_bound #define bits(x) __builtin_popcountll(x) #define bs binary_search #define sz size #define cl clear #define all(A) A.bg(), A.en() #define REPEAT cout<<"\n";main() #define dig(n) log10(n)+1; #define vi vector<int> #define vl vector<ll> char moves[]={"A,B,X,Y"}; string quess_sequence(int n){ vector<char>ret; char first; string s=""; for(int i=0;i<3;++i){ s=""; for(int j=0;j<n;++j){ s+=moves[i]; } int ans=press(s); if(ans==1){ first=moves[i]; break; } } s=""; s+=first; for(int i=1;i<n;++i){ string tmp=s; for(int j=0;j<3;++i){ if(moves[j]==first) continue; tmp+=moves[j]; if(press(tmp)==i+1){ s=tmp; break; } } } return s; }

Compilation message (stderr)

combo.cpp: In function 'std::string quess_sequence(int)':
combo.cpp:55:13: warning: 'first' may be used uninitialized in this function [-Wmaybe-uninitialized]
   55 |             if(moves[j]==first) continue;
      |             ^~
/usr/bin/ld: /tmp/ccuPOYmq.o: in function `main':
grader.cpp:(.text.startup+0x4c): undefined reference to `guess_sequence[abi:cxx11](int)'
collect2: error: ld returned 1 exit status