제출 #1071039

#제출 시각아이디문제언어결과실행 시간메모리
1071039sleepntsheepAncient Machine (JOI21_ancient_machine)C++17
30 / 100
1755 ms15204 KiB
#include "Anna.h" #include <vector> namespace { } void Anna(int N, std::vector<char> S) { for (int i = 0; i < N; ++i) { int v = S[i] - 'X'; Send((v >> 1)); Send(v & 1); } }
#include "Bruno.h" #include <set> #include <vector> #include <algorithm> using namespace std; namespace { int variable_example = 0; int FunctionExample(int P) { return 1 - P; } } // namespace void Bruno(int N, int L, std::vector<int> A) { vector<int> v(N), ded(N); for (int i = 0; i < N; ++i) v[i] = 2 * A[2 * i] + A[2 * i + 1]; vector<set<int> > oc(3); for (int i = 0; i < N; ++i) oc[v[i]].insert(i); if (oc[0].empty() or oc[2].empty() or *oc[0].begin() > *oc[2].rbegin()) { for (int i = 0; i < N; ++i) Remove(i); return; } int x0 = *oc[0].begin(); int z0 = *oc[2].rbegin(); auto REmove = [&](int i) { if (ded[i]) return; ded[i] = 1; oc[v[i]].erase(i); Remove(i); }; int at = x0; for (; at < z0 ;) { auto zi = oc[2].upper_bound(at); while (1) { auto yi = oc[1].lower_bound(*zi); if (yi == oc[1].begin() or *--yi < x0) break; auto xi = prev(oc[0].lower_bound(*yi)); for (int i = *xi + 1; i < *yi; ++i) REmove(i); for (int i = *yi + 1; i < *zi; ++i) REmove(i); REmove(*yi); if (*xi != x0) REmove(*xi); } for (int i = *zi - 1; i > at; --i) REmove(i); at = *zi; } for (int i = 0; i < N; ++i) REmove(i); }

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

Bruno.cpp:11:5: warning: 'int {anonymous}::FunctionExample(int)' defined but not used [-Wunused-function]
   11 | int FunctionExample(int P) { return 1 - P; }
      |     ^~~~~~~~~~~~~~~
Bruno.cpp:9:5: warning: '{anonymous}::variable_example' defined but not used [-Wunused-variable]
    9 | int variable_example = 0;
      |     ^~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...