이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "meetings.h"
#include <bits/stdc++.h>
#define st first
#define nd second
#define mp make_pair
#define pb push_back
#define mod 1000000007
#define inf 1000000009
#define MAXN 1000005
using namespace std;
typedef long long ll;
typedef pair < int , int > ii;
typedef vector < int > vi;
int n, k, sil[MAXN];
int sor(int x, int y, int z){
if(x == y)return x;
if(z == y)return z;
if(x == z)return x;
return Query(x - 1, y - 1, z - 1) + 1;
}
void coz(vi a, int x){
if(a.empty())
return;
vi b;
int son = a[0];
sil[0] = 1;
// b.pb(a[0]);
// cout << x << " -> " << son << " ";
for(int i = 1; i < a.size(); i++){
int it = a[i];
// cout << *it << " ";
int y = sor(son, x, it);
// cout << son << " " << x << " " << *it << " = " << y << endl;
if(y == x){
sil[i] = 0;
continue;
}
if(y == son){
sil[+i] = 1;
// b.pb(*it);
// b.insert(*it);
continue;
}
son = y;
sil[i] = 1;
// b.pb(*it);
}
// cout << endl;
vi of;
for(int i = 0; i < a.size(); i++)
if(!sil[i])
of.pb(a[i]);
else if(a[i] != son)
b.pb(a[i]);
Bridge(min(x - 1, son - 1), max(x - 1, son - 1));
// cout << x << " " << son << " " << b.size() << endl;
coz(b, son);
coz(of, x);
}
void Solve(int nn) {n = nn;
vi a;
for(int i = 2; i <= n; i++)
a.pb(i);
coz(a, 1);
}
컴파일 시 표준 에러 (stderr) 메시지
meetings.cpp: In function 'void coz(vi, int)':
meetings.cpp:35:19: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for(int i = 1; i < a.size(); i++){
~~^~~~~~~~~~
meetings.cpp:56:19: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for(int i = 0; i < a.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... |