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) {
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 (stderr)
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++){
~~^~~~~~~~~~~~~~
# | 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... |