Submission #438135

# Submission time Handle Problem Language Result Execution time Memory
438135 2021-06-27T16:09:49 Z shahriarkhan ICC (CEOI16_icc) C++14
0 / 100
348 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)/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 9 ms 460 KB Wrong road!
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 23 ms 460 KB Wrong road!
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 96 ms 504 KB Wrong road!
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 46 ms 500 KB Wrong road!
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 348 ms 504 KB Number of queries more than 3550 out of 1775
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 300 ms 504 KB Number of queries more than 3250 out of 1625
2 Halted 0 ms 0 KB -