Submission #365135

#TimeUsernameProblemLanguageResultExecution timeMemory
365135MilosMilutinovicHotter Colder (IOI10_hottercolder)C++14
Compilation error
0 ms0 KiB
#include "grader.h" #include <bits/stdc++.h> using namespace std; int Guess(int G); int HC(int n){ if (n == 1) { return 1; } int ans = 0; vector<int> b; for (int i = 1; i <= n; i++) { b.push_back(Guess(i)); } if (b[0] == 0 && b[1] == -1) { return 1; } int ans = 1; for (int i = 0; i < n; i++) { if (b[i] == 1 && (i == n - 1 || b[i + 1] == -1)) { ans = i + 1; } } return ans; }

Compilation message (stderr)

hottercolder.cpp: In function 'int HC(int)':
hottercolder.cpp:20:7: error: redeclaration of 'int ans'
   20 |   int ans = 1;
      |       ^~~
hottercolder.cpp:12:7: note: 'int ans' previously declared here
   12 |   int ans = 0;
      |       ^~~