Submission #791626

#TimeUsernameProblemLanguageResultExecution timeMemory
791626Sohsoh84라멘 (JOI14_ramen)C++17
Compilation error
0 ms0 KiB
#include "ramen.h" #include <bits/stdc++.h> using namespace std; void Ramen(int N) { vector<int> mn_poss, mx_poss; for (int i = 0; i < N - 1; i += 2) { if (Compare(i, i + 1) == 1) { mn_poss.push_back(i + 1); mx_poss.push_back(i); } else { mn_poss.push_back(i); mx_poss.push_back(i + 1); } } if (N & 1) { mn_poss.push_back(N - 1); mx_poss.push_back(N - 1); } int best_mx = mx_poss.front(); for (int e : mx_poss) { if (e == mx_poss.front()) continue; if (Compare(e, best_mx) == 1) best_mx = e; } int best_mn = mn_poss.front(); for (int e : mn_poss) if (e == mn_poss.front()) continue; if (Compare(best_mn, e) == 1) best_mn = e; Answer(best_mn, best_mx); }

Compilation message (stderr)

ramen.cpp: In function 'void Ramen(int)':
ramen.cpp:31:2: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
   31 |  for (int e : mn_poss)
      |  ^~~
ramen.cpp:33:3: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
   33 |   if (Compare(best_mn, e) == 1)
      |   ^~
ramen.cpp:33:24: error: 'e' was not declared in this scope
   33 |   if (Compare(best_mn, e) == 1)
      |                        ^