# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
595863 | AGE | Sob (COCI19_sob) | C++14 | 36 ms | 4724 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>
#define F first
#define S second
#define pb push_back
#define int long long
using namespace std;
const int N=1e5+10,M=2e3,mod=10;
bool vis[N];
main()
{
int n,m;
cin>>n>>m;
vector<pair<int,int>>v;
for(int i=m;i<n+m;i++){
bitset<36>bt;
int num=0;
bt=i;
for(int j=0;j<ceil(log2(n));j++){
if(bt[j]==1){
num+=(1<<j);
if(vis[num]==0){
vis[num]=1;
break;
}
}
}
if(num==n)
num=0;
v.pb({num,i});
}
sort(v.begin(),v.end());
for(int i=0;i<v.size();i++)
cout<<v[i].F<<" "<<v[i].S<<endl;
return 0;
}
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... |