답안 #638119

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
638119 2022-09-04T16:28:00 Z fadi57 Super Dango Maker (JOI22_dango3) C++17
컴파일 오류
0 ms 0 KB
#include <bits/stdc++.h>
#include "dango3.h"
#include "grader.cpp"

using namespace std;
vector<int>ans[30];
int done[100000+9];
int n,m;
bool check(int idx,int x){
  memset(done,0,sizeof(done));
  vector<int>v;
  done[x]=1;
  for(auto it:ans[idx]){

    done[it]=1;
  }
  for(int i=1;i<=n*m;i++){
    if(done[i]){
        continue;
    }
    v.push_back(i);
  }
  return (Query(v)==m-2);

}
void Solve(int N, int M) {
 int cnt=0;
 n=N; m=M;
      int maxi=0;
   for(int i=1;i<=N*M;i++){

      int st=1;   int en=maxi;     int last=0;
     while(st<=en){
         int mid=(st+en)/2;
         if(check(mid,i)){

            last=mid;
            st=mid+1;
         }else{
           en=mid-1;
         }


     }
     ans[last+1].push_back(i);
      maxi=max(maxi,last+1);

  }
for(int i=1;i<=m;i++){
    Answer(ans[i]);
}


}

Compilation message

dango3.cpp: In function 'void Solve(int, int)':
dango3.cpp:27:6: warning: unused variable 'cnt' [-Wunused-variable]
   27 |  int cnt=0;
      |      ^~~
/usr/bin/ld: /tmp/cchTyNeh.o: in function `Query(std::vector<int, std::allocator<int> > const&)':
grader.cpp:(.text+0x50): multiple definition of `Query(std::vector<int, std::allocator<int> > const&)'; /tmp/ccHRJ4tj.o:dango3.cpp:(.text+0x1e0): first defined here
/usr/bin/ld: /tmp/cchTyNeh.o: in function `Answer(std::vector<int, std::allocator<int> > const&)':
grader.cpp:(.text+0x1c0): multiple definition of `Answer(std::vector<int, std::allocator<int> > const&)'; /tmp/ccHRJ4tj.o:dango3.cpp:(.text+0x210): first defined here
/usr/bin/ld: /tmp/cchTyNeh.o: in function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/ccHRJ4tj.o:dango3.cpp:(.text.startup+0x0): first defined here
collect2: error: ld returned 1 exit status