답안 #101264

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
101264 2019-03-18T05:09:29 Z SomeoneUnknown CEOI16_icc (CEOI16_icc) C++14
0 / 100
38 ms 572 KB
#include "icc.h"
#include <bits/stdc++.h>
using namespace std;

void run(int n) {
    bool joind[n+1][n+1];
    for(int i = 1; i <= n; i++){
        for(int j = 1; j <= n; j++){
            joind[i][j] = i==j;
        }
    }
    for(int i = 1; i <= n; i++){
        vector<int> joinee;
        for(int j = 1; j <= n; j++){
            vector<int> poss;
            for(int k = 1; k <= n; k++){
                if(!joind[j][k]) poss.push_back(k);
            }
            int arr[poss.size()];
            for(int k = 0; k < poss.size(); k++){
                arr[k] = poss[k];
                //printf("%d ", poss[k]);
            }
            //printf("\n");
            int arr2[1];
            arr2[0] = j;
            bool ok = query(1, poss.size(), arr2, arr);
            //printf("k");
            if(ok){
                    joinee.push_back(j);
                    //printf("%d ", j);
            }
            //printf("\n");
        }
        //if(joinee.size() > 2) return;
        setRoad(joinee[joinee.size()-1], joinee[joinee.size()-2]);
        joind[joinee[joinee.size()-1]][joinee[joinee.size()-2]] = joind[joinee[joinee.size()-2]][joinee[joinee.size()-1]] = true;
    }
    /*int a[]={1,2};
    int b[]={3,4};
    query(2,2,a,b);
    setRoad(2,4);
    setRoad(1,3);
    setRoad(1,4);//*/
}

Compilation message

icc.cpp: In function 'void run(int)':
icc.cpp:20:30: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
             for(int k = 0; k < poss.size(); k++){
                            ~~^~~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 512 KB Wrong road!
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 11 ms 512 KB Wrong road!
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 29 ms 560 KB Wrong road!
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 38 ms 512 KB Wrong road!
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 27 ms 568 KB Wrong road!
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 29 ms 572 KB Wrong road!
2 Halted 0 ms 0 KB -