Submission #438764

# Submission time Handle Problem Language Result Execution time Memory
438764 2021-06-28T14:56:59 Z shahriarkhan ICC (CEOI16_icc) C++14
0 / 100
341 ms 520 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 ;
    }
    while(1)
    {
        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 = i + 1 ; j <= N ; ++j)
            {
                if(vis[i][j]) continue ;
                b[siz_b++] = j ;
            }
            if(!siz_b) continue ;
            if(!query(siz_a,siz_b,a,b)) continue ;
            int low = 0 , high = siz_b - 1 ;
            while(low<high)
            {
                int mid = (low+high)/2 , c[N+1] , siz_c = 0 ;
                for(int k = low ; k <= mid ; ++k)
                {
                    c[siz_c++] = b[k] ;
                }
                if(query(siz_a,siz_c,a,c)) high = mid ;
                else low = mid + 1 ;
            }
            int node = b[low] ;
            b[0] = node ;
            if(!query(1,1,a,b)) continue ;
            if(vis[i][node]) continue ;
            vis[i][node] = 1 , vis[node][i] = 1 ;
            setRoad(i,node) ;
            break ;
        }
    }
}
# Verdict Execution time Memory Grader output
1 Incorrect 5 ms 460 KB Wrong road!
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 20 ms 460 KB Wrong road!
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 82 ms 460 KB Wrong road!
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 47 ms 504 KB Wrong road!
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 341 ms 508 KB Number of queries more than 3550 out of 1775
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 312 ms 520 KB Number of queries more than 3250 out of 1625
2 Halted 0 ms 0 KB -