Submission #102432

#TimeUsernameProblemLanguageResultExecution timeMemory
102432DrumpfTheGodEmperorXylophone (JOI18_xylophone)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> #define bp __builtin_popcountll #define pb push_back #define in(s) freopen(s, "r", stdin); #define inout(s, end1, end2) freopen((string(s) + "." + end1).c_str(), "r", stdin),\ freopen((string(s) + "." + end2).c_str(), "w", stdout); #define fi first #define se second #define bw(i, r, l) for (int i = r - 1; i >= l; i--) #define fw(i, l, r) for (int i = l; i < r; i++) #define fa(i, x) for (auto i: x) using namespace std; const int mod = 1e9 + 7, inf = 1061109567; const long long infll = 4557430888798830399; const int N = 5005; int ask(int l, int r) { return query(l + 1, r + 1); } int ans(int i, int a) { answer(i + 1, a); } int solve(int n) { int pos1 = -1; fw (i, 0, n) { int tmp = ask(i, n - 1); if (tmp != n - 1) { pos1 = i - 1; break; } } ans(pos1, 1); fw (i, 0, n) { if (pos1 == i) continue; if (i < pos1) { int tmp = ask(i, pos1); ans(i, tmp + 1); } else { int tmp = ask(pos1, i); ans(i, tmp + 1); } } } //signed main() { // #ifdef BLU // in("blu.inp"); // #endif // ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); // // return 0; //}

Compilation message (stderr)

xylophone.cpp: In function 'int ask(int, int)':
xylophone.cpp:16:32: error: 'query' was not declared in this scope
 int ask(int l, int r) { return query(l + 1, r + 1); }
                                ^~~~~
xylophone.cpp: In function 'int ans(int, int)':
xylophone.cpp:17:25: error: 'answer' was not declared in this scope
 int ans(int i, int a) { answer(i + 1, a); }
                         ^~~~~~
xylophone.cpp:17:25: note: suggested alternative: 'ans'
 int ans(int i, int a) { answer(i + 1, a); }
                         ^~~~~~
                         ans
xylophone.cpp:17:43: warning: no return statement in function returning non-void [-Wreturn-type]
 int ans(int i, int a) { answer(i + 1, a); }
                                           ^
xylophone.cpp: In function 'int solve(int)':
xylophone.cpp:38:1: warning: no return statement in function returning non-void [-Wreturn-type]
 }
 ^