Submission #935098

#TimeUsernameProblemLanguageResultExecution timeMemory
9350981075508020060209tcChameleon's Love (JOI20_chameleon)C++14
Compilation error
0 ms0 KiB
#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 (stderr)

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;
      |            ^~