# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
642142 | skittles1412 | Ancient Machine (JOI21_ancient_machine) | C++17 | 53 ms | 8080 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "bits/extc++.h"
using namespace std;
template <typename T>
void dbgh(const T& t) {
cerr << t << endl;
}
template <typename T, typename... U>
void dbgh(const T& t, const U&... u) {
cerr << t << " | ";
dbgh(u...);
}
#ifdef DEBUG
#define dbg(...) \
cerr << "L" << __LINE__ << " [" << #__VA_ARGS__ << "]" \
<< ": "; \
dbgh(__VA_ARGS__)
#else
#define cerr \
if (false) \
cerr
#define dbg(...)
#endif
#define endl "\n"
#define long int64_t
#define sz(x) int(std::size(x))
void Send(int a);
void Anna(int n, vector<char> arr) {
int i = 0;
auto send_until = [&](char c) -> void {
while (i < n) {
if (arr[i++] == c) {
Send(1);
break;
} else {
Send(0);
}
}
};
send_until('X');
while (i < n) {
send_until('Y');
send_until('Z');
}
}
#include "bits/extc++.h"
using namespace std;
template <typename T>
void dbgh(const T& t) {
cerr << t << endl;
}
template <typename T, typename... U>
void dbgh(const T& t, const U&... u) {
cerr << t << " | ";
dbgh(u...);
}
#ifdef DEBUG
#define dbg(...) \
cerr << "L" << __LINE__ << " [" << #__VA_ARGS__ << "]" \
<< ": "; \
dbgh(__VA_ARGS__)
#else
#define cerr \
if (false) \
cerr
#define dbg(...)
#endif
#define endl "\n"
#define long int64_t
#define sz(x) int(std::size(x))
void Remove(int d);
void Bruno(int n, int, vector<int> arr) {
int i = 0;
auto rm = [&](int x) -> void {
if (x != -1) {
Remove(x);
}
};
auto read_until = [&]() -> int {
while (i < n) {
if (arr[i]) {
return i++;
}
rm(i++);
}
return -1;
};
int cx = read_until();
while (i < n) {
int cy = read_until(), cz = read_until();
rm(cy);
rm(cz);
}
rm(cx);
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |