제출 #670657

#제출 시각아이디문제언어결과실행 시간메모리
670657gustavo_d동굴 (IOI13_cave)C++17
컴파일 에러
0 ms0 KiB
#include "cave.h" #include <bits/stdc++.h> using namespace std; void exploreCave(int N) { int n = N; int confirmed[n]; int test[n]; int correspondence[n]; for (int i = 0; i < n; i++) test[i] = 0; correspondence[i] = i; ios_base::sync_with_stdio(false); cin.tie(NULL); for(int to_try = 0; to_try<n; to_try++) { int l = 0; int r = n-1; int certo = 0; for (int i = 0; i<r; i++) { if (confirmed[i] != -1) test[i] = confirmed[i]; else test[i] = 1; } if (tryCombination(test) != to_try) certo = 1; confirmed[l] = certo; } answer(confirmed, correspondence); }

컴파일 시 표준 에러 (stderr) 메시지

cave.cpp: In function 'void exploreCave(int)':
cave.cpp:10:5: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
   10 |     for (int i = 0; i < n; i++)
      |     ^~~
cave.cpp:12:9: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
   12 |         correspondence[i] = i;
      |         ^~~~~~~~~~~~~~
cave.cpp:12:24: error: 'i' was not declared in this scope
   12 |         correspondence[i] = i;
      |                        ^