#include "icc.h"
#include <bits/stdc++.h>
using namespace std;
#define all(x) begin(x), end(x)
#define sz(x) ((int)size(x))
#define trace(x) cout << #x << ": " << (x) << endl;
typedef long long ll;
int query(int size_a, int size_b, int a[], int b[]);
void run(int n);
void setRoad(int a, int b);
int ask(vector<int> a, vector<int> b) {
query(sz(a), sz(b), a.data(), b.data());
}
void run(int n) {
vector<vector<bool>> ws(n, vector<bool>(n));
for (int cnt = 1; cnt <= n - 1; ++cnt) {
for (int i = 1; i <= n; ++i) {
bool ok = false;
for (int j = i + 1; j <= n; ++j) {
if (!ws[i - 1][j - 1] && ask({i}, {j})) {
ws[i - 1][j - 1] = true;
setRoad(i, j);
ok = true;
break;
}
}
if (ok) {
break;
}
}
}
}
Compilation message
icc.cpp: In function 'int ask(std::vector<int>, std::vector<int>)':
icc.cpp:20:1: warning: no return statement in function returning non-void [-Wreturn-type]
20 | }
| ^
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
127 ms |
262144 KB |
Execution killed with signal 9 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
113 ms |
262144 KB |
Execution killed with signal 9 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
113 ms |
262144 KB |
Execution killed with signal 9 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
113 ms |
262144 KB |
Execution killed with signal 9 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
119 ms |
262144 KB |
Execution killed with signal 9 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
104 ms |
262144 KB |
Execution killed with signal 9 |
2 |
Halted |
0 ms |
0 KB |
- |