#include "icc.h"
#include <bits/stdc++.h>
using namespace std;
void run(int n) {
set<int> s;
for (int i = 1; i <= n; i++) s.insert(i);
int a[1],b[1];
vector<int> fixed;
for (int i =1; i <= n; i++){
for (int j = 1; j <= n; j++){
a[0] = i,b[0] = j;
if (query(1,1,a,b)){
s.erase(i);
s.erase(j);
fixed.push_back(i);
fixed.push_back(j);
setRoad(i,j);
break;
}
}
}
for (int i = 1; i < n-1; i++){
int a1[fixed.size()],b1[1];
for (int j = 0; j < fixed.size(); j++) a1[j] = fixed[j];
for (auto it = s.begin(); it != s.end(); ++it){
int val = *it;
b1[0] = val;
if (query(fixed.size(),1,a1,b1)){
int a2[1],b2[1];
b2[0] = val;
for (int j = 0; j < fixed.size(); j++){
a2[0] = fixed[j];
if (query(1,1,a2,b2)){
setRoad(a2[0],b2[0]);
break;
}
}
fixed.push_back(val);
s.erase(val);
break;
}
}
}
}
Compilation message
icc.cpp: In function 'void run(int)':
icc.cpp:25:27: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for (int j = 0; j < fixed.size(); j++) a1[j] = fixed[j];
~~^~~~~~~~~~~~~~
icc.cpp:32:35: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for (int j = 0; j < fixed.size(); j++){
~~^~~~~~~~~~~~~~
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
3 ms |
384 KB |
The query sets must be disjoint |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
384 KB |
The query sets must be disjoint |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
2 ms |
384 KB |
The query sets must be disjoint |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
2 ms |
384 KB |
The query sets must be disjoint |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
3 ms |
384 KB |
The query sets must be disjoint |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
2 ms |
384 KB |
The query sets must be disjoint |
2 |
Halted |
0 ms |
0 KB |
- |