#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[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
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 |
Correct |
15 ms |
640 KB |
Ok! 210 queries used. |
2 |
Incorrect |
10 ms |
640 KB |
Not all edges were guessed! |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
19 ms |
512 KB |
Not all edges were guessed! |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
412 ms |
512 KB |
Not all edges were guessed! |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
60 ms |
512 KB |
Not all edges were guessed! |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
44 ms |
632 KB |
Not all edges were guessed! |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
280 ms |
576 KB |
Number of queries more than 3250 out of 1625 |
2 |
Halted |
0 ms |
0 KB |
- |