Submission #811228

#TimeUsernameProblemLanguageResultExecution timeMemory
811228pccSob (COCI19_sob)C++14
0 / 110
1 ms340 KiB
#include <bits/stdc++.h> using namespace std; #define ll long long #define pll pair<ll,ll> #define pii pair<int,int> #define fs first #define sc second int calc(int k){ int re = 0; while(!(k&1))k>>=1,re++; return re; } int main(){ ios::sync_with_stdio(0);cin.tie(0);cout.tie(0); int n,m; cin>>n>>m; if(n>3000){ int start = m; for(int i = m;i<n+m;i++){ if(calc(start)<calc(i))start = i; } int now = start; for(int i = 0;i<n;i++){ cout<<i<<' '<<now<<'\n'; now++; if(now == n+m)now = m; } } else{ for(int i = 0;i<n;i++){ cout<<i<<" "; for(int j = m;j<n+m;j++){ if((i&j) == i){ cout<<j<<'\n'; break; } if(j == n+m-1)assert(false); } } } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...