제출 #256244

#제출 시각아이디문제언어결과실행 시간메모리
256244Sorting동굴 (IOI13_cave)C++17
0 / 100
1272 ms888 KiB
#include "cave.h" #include <bits/stdc++.h> using namespace std; const int k_N = 5000 + 3; int tryCombination(int S[]); void answer(int S[], int D[]); int s[k_N], d[k_N]; vector<int> curr; void exploreCave(int n){ for(int i = 0; i < n; ++i) curr.push_back(i); for(int i = 0; i < n; ++i){ for(int j = 0; j < curr.size(); ++j) s[curr[j]] = 0; int q1 = tryCombination(s); if(q1 == -1) q1 = n; int l = 0, r = (int)curr.size() - 1; while(l != r){ int mid = (l + r + 1) >> 1; for(int j = 0; j <= mid; ++j) s[curr[j]] = !(q1 > i); int q2 = tryCombination(s); if(q2 == -1) q2 = n; if(q2 > i) l = mid; else r = mid - 1; } d[i] = l; s[i] = !(q1 > i); } answer(s, d); }

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

cave.cpp: In function 'void exploreCave(int)':
cave.cpp:19:26: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         for(int j = 0; j < curr.size(); ++j)
                        ~~^~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...