Submission #102433

#TimeUsernameProblemLanguageResultExecution timeMemory
102433DrumpfTheGodEmperorXylophone (JOI18_xylophone)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> #include "xylophone.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) { return 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 ans(int, int)':
xylophone.cpp:18:47: error: void value not ignored as it ought to be
 int ans(int i, int a) { return answer(i + 1, a); }
                                               ^
xylophone.cpp: In function 'int solve(int)':
xylophone.cpp:19:5: error: ambiguating new declaration of 'int solve(int)'
 int solve(int n) {
     ^~~~~
In file included from xylophone.cpp:2:0:
xylophone.h:3:6: note: old declaration 'void solve(int)'
 void solve(int N);
      ^~~~~
xylophone.cpp:39:1: warning: no return statement in function returning non-void [-Wreturn-type]
 }
 ^