#include "icc.h"
#include <bits/stdc++.h>
using namespace std;
typedef int ll;
const ll INF = 1e9+7;
const ll MOD = 998244353;
typedef pair<ll,ll> ii;
#define iii pair<ll,ii>
#define f(i,a,b) for(ll i = a;i < b;i++)
#define pb push_back
#define vll vector<ll>
#define F first
#define S second
#define all(x) (x).begin(), (x).end()
///I hope I will get uprating and don't make mistakes
///I will never stop programming
///sqrt(-1) Love C++
///Please don't hack me
///@TheofanisOrfanou Theo830
///Think different approaches (bs,dp,greedy,graphs,shortest paths,mst)
///Stay Calm
///Look for special cases
///Beware of overflow and array bounds
///Think the problem backwards
///CEOI 2016 day 1
/*
int query(int size_a, int size_b, int a[], int b[]){
cout<<size_a<<" : ";
f(i,0,size_a){
cout<<a[i]<<" ";
}
cout<<"\n";
cout<<size_b<<" : ";
f(i,0,size_b){
cout<<b[i]<<" ";
}
cout<<"\n";
ll v;
cin>>v;
return v;
}
*/
vector<set<ll> >adj;
ll posa = 0;
void run(int N){
ll n = N;
adj.assign(n+5,set<ll>());
while(1){
bool stop = 0;
ll posa = 0;
ll a,b;
f(i,1,n+1){
f(j,i+1,n+1){
ll A[1] = {i};
ll B[1] = {j};
if(!adj[i].count(j) && query(1,1,A,B) == 1){
//adj[i].insert(j);
// adj[j].insert(i);
posa++;
a = i,b = j;
}
}
}
adj[a].insert(b);
adj[b].insert(a);
setRoad(a,b);
}
}
/*
int main(){
run(4);
}
*/
Compilation message
icc.cpp: In function 'void run(int)':
icc.cpp:49:14: warning: unused variable 'stop' [-Wunused-variable]
49 | bool stop = 0;
| ^~~~
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
56 ms |
468 KB |
Ok! 1379 queries used. |
2 |
Incorrect |
13 ms |
488 KB |
Wrong road! |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
249 ms |
488 KB |
Number of queries more than 5000 out of 2500 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
329 ms |
484 KB |
Number of queries more than 4500 out of 2250 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
305 ms |
484 KB |
Number of queries more than 4000 out of 2000 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
277 ms |
480 KB |
Number of queries more than 3550 out of 1775 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
259 ms |
480 KB |
Number of queries more than 3250 out of 1625 |
2 |
Halted |
0 ms |
0 KB |
- |