이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
#define needforspeed ios::sync_with_stdio(0);cin.tie(0);
#define int long long int
#define pb push_back
#define ins insert
#define endl '\n'
#define putr(x) cout<<x<<endl;return;
#define all(x) x.begin(),x.end()
const int mod = 1e9 +7,sze = 1e5 +23,inf = INT_MAX, L = 23;
//ref: https://oj.uz/submission/858556
void opt1z(){
int n,m;
cin>>n>>m;
vector<int> arr,brr;
for(int i=0;i<n;i++){
arr.pb(i);
}
for(int i = n+m-1;i>=m;i--){
brr.pb(i);
}
while(!arr.empty()){
vector<int> lst;
while((arr.back() & brr.back())!=arr.back()){
lst.pb(brr.back());
brr.pop_back();
}
lst.pb(brr.back());
brr.pop_back();
while(!lst.empty()){
cout<<arr.back()<<" "<<lst.back()<<endl;
lst.pop_back();
arr.pop_back();
}
}
}
signed main() {
needforspeed;
int tt = 1;
// cin>>tt;
while(tt--){
opt1z();
}
return 0;
}
# | 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... |