Submission #875046

#TimeUsernameProblemLanguageResultExecution timeMemory
875046amin_2008Combo (IOI18_combo)C++17
Compilation error
0 ms0 KiB
#pragma GCC optimize ("O3") #pragma GCC optimize("O3,unroll-loops") #pragma GCC target("avx,avx2,fma") #include <bits/stdc++.h> #include<ext/pb_ds/assoc_container.hpp> #include<ext/pb_ds/tree_policy.hpp> #include "combo.h" // author: amin_2008 #define ios ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0) #define ll long long #define vi vector<int> #define vs vector<string> #define vc vector<char> #define vl vector<ll> #define all(v) v.begin(), v.end() #define rall(v) v.rbegin(), v.rend() #define pb push_back #define bpc __builtin_popcount #define pii pair<int, int> #define pll pair<ll, ll> #define piii pair<pii, int> #define vpii vector<pii> #define vpll vector<pll> #define vvpii vector<vpii> #define vvi vector<vector<int>> #define vvl vector<vector<ll>> #define ins insert #define ts to_string #define F first #define S second #define lb lower_bound #define ub upper_bound #define ld long double #define ull unsigned long long #define endl '\n' //#define int ll using namespace std; using namespace __gnu_pbds; using namespace __cxx11; template<class T> using ordered_set = tree<T, null_type,less<T>, rb_tree_tag,tree_order_statistics_node_update>; mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()); const ll inf = 2e5 * 1e9; const int mod = 1e9+7; const int sz = 2e5+5; const int N = 5001; const int logg = 18; const int P = 40000005; const ll M = 4; int a[sz]; const char ch[] = "ABXY"; int guess(const string& s) { int szz = press(s + ch[0] + s + ch[1]); int in = ( szz < s.size() + 1 ) << 1; szz = press(s + ch[in]); in += ( szz < s.size() + 1 ); return in; } string seg(int n) { int in[M]; for(int i = 0; i < M; i++) in[i] = i; string s; { int id = guess(s); s += ch[id]; swap(in[id], in[M-1]); } for(int i = 0; i < n - 2; i++) { string z; for(int j = 0; j < M - 1; j++) z += s + ch[in[0]] + ch[in[j]]; z += s + ch[in[1]]; int szz = press(z); if ( szz = i + 3 ) s += ch[in[0]]; else if ( szz = i + 2 ) s += ch[in[1]]; else s += ch[in[2]]; } if ( n > 1 ) { int id = guess(s); s += ch[id]; } return s; } //void solve() //{ // //} // //signed main() //{ // ios; // //precompute(); // int t = 1; // //cin >> t; // while(t--){ // solve(); // } //}

Compilation message (stderr)

combo.cpp: In function 'int guess(const string&)':
combo.cpp:61:20: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   61 |     int in = ( szz < s.size() + 1 ) << 1;
      |                ~~~~^~~~~~~~~~~~~~
combo.cpp:63:17: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   63 |     in += ( szz < s.size() + 1 );
      |             ~~~~^~~~~~~~~~~~~~
combo.cpp: In function 'std::string seg(int)':
combo.cpp:85:18: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
   85 |         if ( szz = i + 3 )
      |              ~~~~^~~~~~~
combo.cpp:87:23: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
   87 |         else if ( szz = i + 2 )
      |                   ~~~~^~~~~~~
/usr/bin/ld: /tmp/ccHsXOqL.o: in function `main':
grader.cpp:(.text.startup+0x4c): undefined reference to `guess_sequence[abi:cxx11](int)'
collect2: error: ld returned 1 exit status