# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
41070 | IvanC | 전압 (JOI14_voltage) | C++14 | 375 ms | 64020 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
typedef pair<int,int> ii;
const int MAXN = 1e5 + 10;
const int MAXM = 2*1e5 + 10;
int e1[MAXM],e2[MAXM],pai[MAXN],ligapai[MAXN],peso[MAXN],N,M,ans;
int possivel,last,oldw[MAXM],oldz[MAXM],oldpai[MAXM],oldliga[MAXM],oldpeso[MAXM],oldpossivel[MAXM];
int find(int x){
if(x == pai[x]) return x;
return find(pai[x]);
}
int parity(int x){
if(x == pai[x]) return 0;
return (ligapai[x] ^ parity(pai[x]));
}
void join(int x,int y){
int w = find(x), z = find(y),px = parity(x),py = parity(y);
if(peso[w] < peso[z]){
swap(w,z);
swap(px,py);
swap(x,y);
}
last++;
oldw[last] = w;
oldz[last] = z;
oldpai[last] = pai[z];
oldliga[last] = ligapai[z];
oldpeso[last] = peso[w];
oldpossivel[last] = possivel;
if(w == z){
컴파일 시 표준 에러 (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... |