# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1075619 | edogawa_something | Simurgh (IOI17_simurgh) | C++17 | 14 ms | 604 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "simurgh.h"
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vii;
typedef pair<ll,ll> pii;
#define F first
#define S second
#define all(v) v.begin(),v.end()
#define pb push_back
struct dsu {
ll pa[50];
void init(ll x) {
for(int i=0;i<=x;i++)
pa[i]=i;
}
ll get(ll x) {
if(x==pa[x])
return x;
return pa[x]=get(pa[x]);
}
bool unite(ll x,ll y) {
x=get(x),y=get(y);
if(x==y)
return 0;
pa[x]=y;
return 1;
}
}d;
std::vector<int> find_roads(int n, std::vector<int> u, std::vector<int> vv) {
for(int i=0;i<(1<<(u.size()));i++) {
if(__builtin_popcount(i)==n-1) {
vector<int>v;
d.init(n);
bool chk=1;
for(int bit=0;bit<u.size();bit++) {
if(((1<<bit)&i)) {
chk&=d.unite(u[bit],vv[bit]);
v.pb(bit);
}
}
if(chk) {
ll x=count_common_roads(v);
if(x==n-1) {
return v;
}
}
}
}
return {};
}
컴파일 시 표준 에러 (stderr) 메시지
# | 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... |