제출 #248228

#제출 시각아이디문제언어결과실행 시간메모리
248228lyc로카히아 유적 (FXCUP4_lokahia)C++17
0 / 100
2 ms640 KiB
#include "lokahia.h" #include <bits/stdc++.h> using namespace std; #define FOR(i,a,b) for(int i=(a);i<=(b);++i) #define RFOR(i,a,b) for(int i=(a);i>=(b);--i) int FindBase(int N){ int x = 0, y = 1, z; FOR(i,1,N-1){ if (y == 0) x = i, y = 1; else if (x == i || (z = CollectRelics(x,i)) != -1) x = z, ++y; else --y; } int c = 1; FOR(i,0,N-1) if (x != i) { if (CollectRelics(x,i) != -1) ++c; } return (c > N/2 ? x : -1); }

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

lokahia.cpp: In function 'int FindBase(int)':
lokahia.cpp:16:18: warning: 'x' may be used uninitialized in this function [-Wmaybe-uninitialized]
     FOR(i,0,N-1) if (x != i) {
                  ^~
#Verdict Execution timeMemoryGrader output
Fetching results...