Submission #438136

# Submission time Handle Problem Language Result Execution time Memory
438136 2021-06-27T16:10:11 Z shahriarkhan ICC (CEOI16_icc) C++14
0 / 100
316 ms 504 KB
#include<bits/stdc++.h>
#include "icc.h"
using namespace std ;

void run(int N)
{
    int vis[N+1][N+1] ;
    for(int i = 0 ; i <= N ; ++i)
    {
        for(int j = 0 ; j <= N ; ++j)
        {
            vis[i][j] = 0 ;
        }
        vis[i][i] = 1 ;
    }
    for(int T = 1 ; T < N ; ++T)
    {
        for(int i = 1 ; i <= N ; ++i)
        {
            int a[1] , b[N+1] , siz_a = 1 , siz_b = 0 ;
            a[0] = i ;
            for(int j = 1 ; j <= N ; ++j)
            {
                if(vis[i][j]) continue ;
                b[siz_b++] = j ;
            }
            if(!query(siz_a,siz_b,a,b)) continue ;
            int low = 0 , high = siz_b - 1 ;
            while(low<high)
            {
                int mid = (low+high+1)/2 , c[N+1] , siz_c = 0 ;
                for(int i = low ; i <= mid ; ++i)
                {
                    c[siz_c++] = b[i] ;
                }
                if(query(siz_a,siz_c,a,c)) high = mid ;
                else low = mid + 1 ;
            }
            int node = b[low] ;
            vis[i][node] = 1 , vis[node][i] = 1 ;
            setRoad(i,node) ;
            break ;
        }
    }
}
# Verdict Execution time Memory Grader output
1 Incorrect 173 ms 464 KB Number of queries more than 3000 out of 1500
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 309 ms 472 KB Number of queries more than 5000 out of 2500
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 316 ms 500 KB Number of queries more than 4500 out of 2250
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 280 ms 504 KB Number of queries more than 4000 out of 2000
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 238 ms 500 KB Number of queries more than 3550 out of 1775
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 225 ms 460 KB Number of queries more than 3250 out of 1625
2 Halted 0 ms 0 KB -