Submission #465563

# Submission time Handle Problem Language Result Execution time Memory
465563 2021-08-16T10:58:24 Z BT21tata ICC (CEOI16_icc) C++17
0 / 100
284 ms 472 KB
#include<bits/stdc++.h>
#include "icc.h"
// #pragma GCC target ("avx,avx2,fma")
// #pragma GCC optimize("Ofast")
// #pragma GCC optimize("unroll-loops")
typedef long long ll;
typedef long double ld;
#define SPEED ios_base::sync_with_stdio(false); cin.tie(0), cout.tie(0)
#define rall(v) (v).rbegin(),(v).rend()
#define all(v) (v).begin(),(v).end()
#define OK cerr<<"OK"<<endl<<flush
#define pii pair<int, int>
#define pll pair<ll, ll>
#define pb push_back
#define F first
#define S second
#define y0 jahdakdh
#define y1 jahsadakdakdh
#define endl '\n'
const ll MOD=1e9+7;
using namespace std;
//mt19937 rng(std::chrono::system_clock::now().time_since_epoch().count());
 
bool e[105][105];
 
int bs(int x, int n)
{
    vector<int>v;
    for(int i=x+1; i<=n; i++)
        if(!e[x][i]) v.pb(i);
    int l=0, r=v.size()-1, mid;
    while(l<=r)
    {
        mid=(l+r)>>1;
        int b[n], pos=0;
        for(int i=l; i<=mid; i++)
            b[pos++]=v[i];
        bool f=query(1, mid-l+1, &x, b);
        if(f) r=mid;
        else l=mid+1;
    }
    return v[l];
}
 
void run(int n)
{
    for(int cnt=1; cnt<n; cnt++)
    {
        for(int i=1; i<=n; i++)
        {
            int numb=0, b[n];
            for(int j=i+1; j<=n; j++)
                if(!e[i][j]) b[numb++]=j;
            if(!numb) continue;
            
            bool f=query(1, numb, &i, b);
            if(f)
            {
                int x=bs(i, n);
                setRoad(i, x);
                e[i][x]=e[x][i]=1;
            }
        }
    }
 
}
# Verdict Execution time Memory Grader output
1 Incorrect 180 ms 460 KB Number of queries more than 3000 out of 1500
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 274 ms 468 KB Number of queries more than 5000 out of 2500
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 284 ms 468 KB Number of queries more than 4500 out of 2250
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 268 ms 472 KB Number of queries more than 4000 out of 2000
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 234 ms 468 KB Number of queries more than 3550 out of 1775
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 205 ms 468 KB Number of queries more than 3250 out of 1625
2 Halted 0 ms 0 KB -