This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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");
}
setRoad(joinee[0], joinee[1]);
joind[joinee[0]][joinee[1]] = joind[joinee[1]][joinee[0]] = 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 (stderr)
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 |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |