Submission #935098

# Submission time Handle Problem Language Result Execution time Memory
935098 2024-02-28T15:32:12 Z 1075508020060209tc Chameleon's Love (JOI20_chameleon) C++14
Compilation error
0 ms 0 KB
#include "chameleon.h"
#include <vector>
#include<bits/stdc++.h>
using namespace std;

int n;
int vis[2010];
int clc(int l,int r,int &a,int &b){
vector<int>vc;
for(int i=l;i<=r;i++){
    if(vis[i]){continue;}
    vc.push_back(i);
}
if(vc.size()==0){
    a=0;
    b=0;return;
}
a=vc.size();b=Query(vc);
}

void Solve(int N) {
n=N;

int tc=n;
while(tc--){
    int l=1;int r=n*2;
    while(l<r){
        int mi=l+(r-l)/2;
        int a;int b;
        clc(1,mi,a,b);
        if(a!=b){
            r=mi;
        }else{
            l=mi+1;
        }
    }
    l=1;
    int R=r;
    while(l<r){
        int mi=l+(r-l+1)/2;
        int a;int b;
        clc(mi,R,a,b);
        if(a!=b){
            l=mi;
        }else{
            r=mi-1;
        }
    }
    Answer(l,R);
    vis[l]=1;vis[R]=1;
}


}

Compilation message

chameleon.cpp: In function 'int clc(int, int, int&, int&)':
chameleon.cpp:16:9: error: return-statement with no value, in function returning 'int' [-fpermissive]
   16 |     b=0;return;
      |         ^~~~~~
chameleon.cpp:9:12: warning: control reaches end of non-void function [-Wreturn-type]
    9 | vector<int>vc;
      |            ^~