제출 #550051

#제출 시각아이디문제언어결과실행 시간메모리
550051palilo동굴 (IOI13_cave)C++17
0 / 100
20 ms468 KiB
#include "cave.h" #include <bits/stdc++.h> void exploreCave(int n) { using namespace std; vector s(n, 0), d(n, -1); auto solve = [&](int door_id) { const auto is_one {tryCombination(s.data()) == door_id}; int lo = 0, hi = n; while (lo != hi) { const auto mid {(lo + hi) >> 1}; transform(d.begin() + lo, d.begin() + mid, s.begin() + lo, [&](const auto& x) { return x == -1 ? -1 : 1; }); tryCombination(d.data()) == door_id == is_one ? lo = mid + 1 : hi = mid; } s[lo] = is_one; d[lo] = door_id; }; for (int i = 0; i < n; ++i) { solve(i); } answer(s.data(), d.data()); }

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

cave.cpp: In lambda function:
cave.cpp:13:38: warning: suggest parentheses around comparison in operand of '==' [-Wparentheses]
   13 |             tryCombination(d.data()) == door_id == is_one ? lo = mid + 1 : hi = mid;
      |             ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~
#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...