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"queue"
// #include"deque"
// #include"set"
// #include"map"
// #include"algorithm"
// #include"iomanip"
// #include"cstring"
// #include"cmath"
// #include"bitset"
// #define int long long
// __LINE__
using namespace std;
void solve(){
int n,m;
cin >> n >> m;
int last=m;
for(int i=n-1;i>=0;){
for(int j=last;last<n+m;j++){
if((i&j)==i){
int tmp = j;
while(tmp>=last && (tmp&i)==i){
cout << i << " " << tmp << "\n";
i--;
tmp--;
}
last=j+1;
break;
}
}
}
}
signed main(){
ios::sync_with_stdio(false); cin.tie(0);
// freopen("","r",stdin);freopen("","w",stdout);
int t=1;
// cin >> t;
for(int i=1;i<=t;i++){
// cout << "Case " << i << ":\n";
solve();
// cout <<"\n\n";
}
}
# | 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... |