# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
101251 |
2019-03-18T04:50:13 Z |
SomeoneUnknown |
ICC (CEOI16_icc) |
C++14 |
|
443 ms |
640 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 = 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
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 |
Correct |
14 ms |
512 KB |
Ok! 210 queries used. |
2 |
Incorrect |
9 ms |
512 KB |
Wrong road! |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
18 ms |
512 KB |
Wrong road! |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
443 ms |
572 KB |
Wrong road! |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
69 ms |
568 KB |
Wrong road! |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
49 ms |
560 KB |
Wrong road! |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
346 ms |
640 KB |
Number of queries more than 3250 out of 1625 |
2 |
Halted |
0 ms |
0 KB |
- |