Submission #385511

#TimeUsernameProblemLanguageResultExecution timeMemory
385511ismoilovCombo (IOI18_combo)C++14
Compilation error
0 ms0 KiB
#include<bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> pii; typedef pair<ll, ll> pll; #define IOS ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); #define all(x) (x).begin(), (x).end() #define rall(x) (x).begin(), (x).end() #define fp(a,i,c) for(int (a) = (i); (a) < (c); (a)++) #define fpp(a,i,c) for(int (a) = (i); (a) <= (c); (a)++) #define fv(c) for(int (a) = (1); (a) <= (c); (a)++) #define fz(c) for(int (a) = (0); (a) < (c); (a)++) #define fm(a,i,c) for(int (a) = (i); (a) > (c); (a)--) #define fmm(a,i,c) for(int (a) = (i); (a) >= (c); (a)--) #define pb push_back #define in insert #define ss second #define ff first void S() { int n; cin >> n; string s, c = "ABXY"; fp(i,0,4) { fp(j,0,n) s += c[i]; cout << "press(" << '"' << s << '"' << ")" << endl; int x; cin >> x; if(x > 0) break; s = ""; } c.erase((c.find(s[0])), 1); int f = 1, i = 1, j = 0; while(f != n) { fp(k,i,n) s[k] = c[j]; cout << "press(" << '"' << s << '"' << ")" << endl; int x; cin >> x; if(x == f) j ++, j %= 3; else { i += x - f, f = x, j = (j + 1)%3; } } cout << s << endl; } int main() { IOS; S(); /*int t; cin >> t; while(t--) S();*/ }

Compilation message (stderr)

combo.cpp: In function 'void S()':
combo.cpp:9:27: warning: unnecessary parentheses in declaration of 'i' [-Wparentheses]
    9 | #define fp(a,i,c) for(int (a) = (i); (a) < (c); (a)++)
      |                           ^
combo.cpp:24:2: note: in expansion of macro 'fp'
   24 |  fp(i,0,4)
      |  ^~
combo.cpp:9:27: warning: unnecessary parentheses in declaration of 'j' [-Wparentheses]
    9 | #define fp(a,i,c) for(int (a) = (i); (a) < (c); (a)++)
      |                           ^
combo.cpp:26:3: note: in expansion of macro 'fp'
   26 |   fp(j,0,n)
      |   ^~
combo.cpp:9:27: warning: unnecessary parentheses in declaration of 'k' [-Wparentheses]
    9 | #define fp(a,i,c) for(int (a) = (i); (a) < (c); (a)++)
      |                           ^
combo.cpp:39:3: note: in expansion of macro 'fp'
   39 |   fp(k,i,n)
      |   ^~
/usr/bin/ld: /tmp/ccTCII0q.o: in function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/ccfbiviq.o:combo.cpp:(.text.startup+0x0): first defined here
/usr/bin/ld: /tmp/ccTCII0q.o: in function `main':
grader.cpp:(.text.startup+0x4c): undefined reference to `guess_sequence[abi:cxx11](int)'
collect2: error: ld returned 1 exit status