# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
442829 | algorithm16 | Sob (COCI19_sob) | C++14 | 122 ms | 11184 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<vector>
#include<algorithm>
using namespace std;
vector <pair<int,int> > v;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
int n,m;
cin >> n >> m;
int ind=0;
for(int i=n-1;i>=0;i--) {
int ind2=ind,i2=i;
while((i & (ind+m))!=i) ind+=1;
for(int j=ind;j>=ind2;j--) {
v.push_back(make_pair(i2,m+j));
i2-=1;
}
ind+=1;
i=i2+1;
}
for(int i=0;i<v.size();i++) {
cout << v[i].first << " " << v[i].second << "\n";
}
return 0;
}
/*
__
/\ \
/ \ \
/ /\ \ \
/ / /\ \ \
/ / /__\_\ \
/ / /________\
\/___________/
*/
/*
5 13
0 1 2 3 4
5 6 7 0 1
000 101
001 110
010 111
011 000
100 001
*/
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... |