Submission #595871

#TimeUsernameProblemLanguageResultExecution timeMemory
595871AGESob (COCI19_sob)C++14
29 / 110
367 ms8288 KiB
#include<bits/stdc++.h> #define F first #define S second #define pb push_back #define int long long using namespace std; const int N=2e6+10,M=2e3,mod=10; bool vis[N]; main() { int n,m; cin>>n>>m; vector<pair<int,int>>v; int x=ceil(log2(n)); for(int i=m;i<n+m;i++){ bitset<32>bt; int num=0; bt=i; for(int j=0;j<x;j++){ if(bt[j]==1){ num+=(1<<j); if(vis[num]==0){ vis[num]=1; break; } } } if(num==n){ num=0; x--; } 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)

sob.cpp:11:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   11 | main()
      | ^~~~
sob.cpp: In function 'int main()':
sob.cpp:48:18: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<std::pair<long long int, long long int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   48 |     for(int i=0;i<v.size();i++)
      |                 ~^~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...