Submission #765015

# Submission time Handle Problem Language Result Execution time Memory
765015 2023-06-24T07:33:20 Z 1075508020060209tc Sob (COCI19_sob) C++14
Compilation error
0 ms 0 KB

#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(){
vector<pair<int,int>>ans;
cin>>n>>m;
int lst=0;
for(int i=n-1;i>=0;i--){
    if(lst!=0&&vis[lst-1]==0&&((i&(lst-1+m))==i)  ){
        lst--;
        ans.push_back({i,lst+m});
        vis[lst]=1;
        continue;
    }
    for(int j=0;j<=n-1;j++){
        if(vis[j]){continue;}
        if( ((i&(j+m))==i)  ){
            ans.push_back({i,j+m});
            lst=j;
            vis[j]=1;
            break;
        }
    }
}
for(int i=0;i<ans.size();i++){
    cout<<ans[i].first<<" "<<ans[i].second<<endl;
}
 

Compilation message

sob.cpp: In function 'int main()':
sob.cpp:32:14: 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]
   32 | for(int i=0;i<ans.size();i++){
      |             ~^~~~~~~~~~~
sob.cpp:34:1: error: expected '}' at end of input
   34 | }
      | ^
sob.cpp:11:14: note: to match this '{'
   11 | signed main(){
      |              ^