이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#include "icc.h"
using namespace std;
typedef pair<int,int> pii;
const int MAXN = 60;
int N;
int other[MAXN];
bool marc[MAXN];
vector< int > adj[MAXN];
void DFS(int cur)
{
marc[ cur ] = true;
for(int i = 0 ; i < adj[cur].size() ; i++)
{
int viz = adj[cur][i];
if( marc[viz] ) continue;
DFS( viz );
}
}
void run(int n)
{
N = n;
for(int k = 1 ; k < N ; k++)
{
bool find = false;
int ansA = 0;
int ansB = 0;
for(int i = 1 ; i <= n && !find ; i++)
{
memset( marc , false , sizeof( marc ) );
DFS( i );
int cur[] = { i };
int p = 0;
for(int j = 1 ; j <= n ; j++)
if( !marc[j] ) other[ p++ ] = j;
if( query( 1 , p , cur , other ) == 1 )
{
ansA = i;
for(int j = 0 ; j < p && !find ; j++)
{
int V[] = { other[j] };
if( query( 1 , 1 , cur , V ) == 1 )
{
ansB = other[j];
find = true;
}
}
}
}
adj[ ansB ].push_back( ansA );
adj[ ansA ].push_back( ansB );
setRoad( ansA , ansB );
}
}
컴파일 시 표준 에러 (stderr) 메시지
icc.cpp: In function 'void DFS(int)':
icc.cpp:21:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for(int i = 0 ; i < adj[cur].size() ; i++)
~~^~~~~~~~~~~~~~~~~
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |