답안 #892509

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
892509 2023-12-25T12:50:26 Z Aiperiii Super Dango Maker (JOI22_dango3) C++17
컴파일 오류
0 ms 0 KB
#include "dango3.h"
#include <bits/stdc++.h>
using namespace std;

void Solve(int n,int m){
    queue < pair < vector <int> ,int >  > q;
    vector <int> in;
    vector <vector <int> > ans;
    for(int i=1;i<=n*m;i++){
        in.push_back(i);
    }
    q.push({in,m});
    while(!q.empty()){
        vector <int> v=q.front().first;
        int k=q.front().second/2;
        q.pop();
        if(k==0){
        
            ans.push_back(v);
        }
        else{
            vector <int> used(v.size());
            for(int i=0;i<v.size();i++){
                used[i]=1;
                vector <int> x;
                for(int j=0;j<v.size();j++){
                    if(used[j]==0)x.push_back(v[j]);
                }
                if(Query(x)<k)used[i]=0;
            }
            vector <int> g1,g2;
            for(int i=0;i<v.size();i++){
                if(used[i]==0)g1.push_back(v[i]);
                else g2.push_back(v[i]);
            }
            q.push({g1,k});
            q.push({g2,k});
        }
        
    }
    for(auto x : ans){
        Answer(x);
    }
    return;
}
int main(){
    int n,m;
    cin>>n>>m;
    Solve(n,m);
}

Compilation message

dango3.cpp: In function 'void Solve(int, int)':
dango3.cpp:23:26: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   23 |             for(int i=0;i<v.size();i++){
      |                         ~^~~~~~~~~
dango3.cpp:26:30: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   26 |                 for(int j=0;j<v.size();j++){
      |                             ~^~~~~~~~~
dango3.cpp:32:26: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   32 |             for(int i=0;i<v.size();i++){
      |                         ~^~~~~~~~~
/usr/bin/ld: /tmp/cc2nQdcT.o: in function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/ccHW5DEP.o:dango3.cpp:(.text.startup+0x0): first defined here
collect2: error: ld returned 1 exit status