# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
442763 | ToniB | Sob (COCI19_sob) | C++14 | 127 ms | 15144 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 <iostream>
#include <algorithm>
#include <string>
#include <queue>
#include <vector>
#include <set>
#include <map>
#include <stack>
#include <cmath>
#include <ext/pb_ds/assoc_container.hpp>
#include <bitset>
using namespace std;
using namespace __gnu_pbds;
#define FOR(i, x, n) for(int i = x; i < n; ++i)
#define REP(i, n) for(int i = 0; i < n; ++i)
#define TRACE(x) cerr << #x << " " << x << endl;
#define endl "\n"
#define mp make_pair
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const int MOD = 1e9+7;
const int inf = 2147483647;
const int maxN = 1e6 + 2;
int m, n;
vector<int> x, y;
int p1, p2, plast;
vector<pii> ans;
int main(){
// ios_base::sync_with_stdio(0);
cin >> n >> m;
REP(i, n) x.push_back(i);
for(int i = m; i < m+n; ++i){
y.push_back(i);
}
p2 = n-1;
while(p2 >= 0){
plast = p1;
while((y[p1] & x[p2]) != x[p2]){
p1++;
}
for(int i = p1; i >= plast; --i){
ans.push_back(mp(x[p2], y[i]));
p2--;
}
p1++;
}
REP(i, ans.size()){
cout << ans[i].first << " " << ans[i].second << endl;
}
return 0;
}
Compilation message (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... |