Submission #101249

# Submission time Handle Problem Language Result Execution time Memory
101249 2019-03-18T04:40:34 Z SomeoneUnknown ICC (CEOI16_icc) C++14
0 / 100
3 ms 512 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 = 0; 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];
            }
            int arr2[1];
            arr2[0] = j;
            if(query(1, poss.size(), arr2, arr)){
                    joinee.push_back(j);
                    printf("%d ", j);
            }
        }
        setRoad(joinee[0], joinee[1]);
    }
    /*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++){
                            ~~^~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 512 KB Query cities not in range [1, n]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 384 KB Query cities not in range [1, n]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 384 KB Query cities not in range [1, n]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 384 KB Query cities not in range [1, n]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 384 KB Query cities not in range [1, n]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 384 KB Query cities not in range [1, n]
2 Halted 0 ms 0 KB -