# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
633972 | Olympia | Sob (COCI19_sob) | C++17 | 123 ms | 80300 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
void rec (vector<pair<int,int> > v1, vector<pair<int,int> > v2) {
for (int len = 1; len <= v1.size(); len++) {
bool fine = true;
vector<pair<int,int> > res;
for (int i = 0; i < len; i++) {
int x1 = v1[v1.size() - len + i].first;
int x2 = v2[i].first;
res.push_back(make_pair(x1, x2));
if ((x1 & x2) != x1) {
fine = false;
break;
}
}
if (fine) {
for (auto& p: res) {
cout << p.first << " " << p.second << '\n';
}
int l = len;
reverse(v2.begin(), v2.end());
while (l--) {
v1.pop_back();
v2.pop_back();
}
reverse(v2.begin(), v2.end());
rec(v1, v2);
return;
}
}
}
int main () {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int N, M;
cin >> N >> M;
vector<pair<int,int> > v1, v2;
v1.resize(N), v2.resize(N);
for (int i = 0; i < N; i++) {
v1[i].first = v1[i].second = i, v2[i].first = v2[i].second = i + M;
}
rec(v1, v2);
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |