Submission #333941

# Submission time Handle Problem Language Result Execution time Memory
333941 2020-12-08T03:46:47 Z daniel920712 ICC (CEOI16_icc) C++14
0 / 100
527 ms 620 KB
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <set>
#include <map>
#include <vector>
#include <queue>
#include <algorithm>
#include <utility>
#include <time.h>
#include <assert.h>
#include "icc.h"

using namespace std;
bool have[105][105]={0};
int a[105],b[105];
void run(int N)
{
    int ok=1,i,j,k,x,y,t1,t2,con=0;
    for(i=1;i<N;i++) for(j=1;j<=N;j++) have[i][j]=0;
    for(i=1;i<N;i++)
    {
        for(j=1;j<=N;j++)
        {
            t1=0;
            t2=0;
            a[0]=j;
            for(k=j+1;k<=N;k++)
            {
                b[0]=k;
                if(j==k) continue;
                if(have[j][k]) continue;
                con++;
                if(query(1,1,a,b))
                {
                    if(!query(1,1,a,b)) while(1) ;
                    x=j;
                    y=k;
                }
            }
        }
        setRoad(x,y);
        have[x][y]=1;
        have[y][x]=1;
    }
}

Compilation message

icc.cpp: In function 'void run(int)':
icc.cpp:19:9: warning: unused variable 'ok' [-Wunused-variable]
   19 |     int ok=1,i,j,k,x,y,t1,t2,con=0;
      |         ^~
icc.cpp:19:24: warning: variable 't1' set but not used [-Wunused-but-set-variable]
   19 |     int ok=1,i,j,k,x,y,t1,t2,con=0;
      |                        ^~
icc.cpp:19:27: warning: variable 't2' set but not used [-Wunused-but-set-variable]
   19 |     int ok=1,i,j,k,x,y,t1,t2,con=0;
      |                           ^~
icc.cpp:44:19: warning: 'y' may be used uninitialized in this function [-Wmaybe-uninitialized]
   44 |         have[y][x]=1;
      |         ~~~~~~~~~~^~
icc.cpp:44:19: warning: 'x' may be used uninitialized in this function [-Wmaybe-uninitialized]
# Verdict Execution time Memory Grader output
1 Correct 100 ms 492 KB Ok! 1393 queries used.
2 Incorrect 31 ms 492 KB Wrong road!
# Verdict Execution time Memory Grader output
1 Incorrect 327 ms 620 KB Wrong road!
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 527 ms 620 KB Number of queries more than 4500 out of 2250
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 474 ms 620 KB Number of queries more than 4000 out of 2000
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 426 ms 576 KB Number of queries more than 3550 out of 1775
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 399 ms 620 KB Number of queries more than 3250 out of 1625
2 Halted 0 ms 0 KB -