# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
765001 | 1075508020060209tc | Sob (COCI19_sob) | C++14 | 1091 ms | 12644 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/stdc++.h>
using namespace std;
#define int long long
#define X first
#define Y second
int n;int m;
int vis[1000006];
signed main(){
cin.tie(0);
ios_base::sync_with_stdio(0);
vector<pair<int,int>>ans;
cin>>n>>m;
set<int>st;
for(int i=0;i<=n-1;i++){
st.insert(i+m);
}
for(int i=n-1;i>=0;i--){
/* for(int j=0;j<=n-1;j++){
if(vis[j]){continue;}
if( ((i&(j+m))==i) ){
ans.push_back({i,j+m});
vis[j]=1;
break;
}
}*/
for(auto it=st.begin();it!=st.end();it++){
int v=*it;
if( ((v&i)==i) ){
ans.push_back({i,v});
st.erase(v);
break;
}
}
}
for(int i=0;i<ans.size();i++){
cout<<ans[i].first<<" "<<ans[i].second<<endl;
}
}
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... |