제출 #413418

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
4134182021-05-28 17:05:25Aryan_RainaPort Facility (JOI17_port_facility)C++17
0 / 100
1 ms204 KiB
#include <bits/stdc++.h>
using namespace std;
#define int int64_t
#define ld long double
#define ar array
const int INF = 1e12;
const int MOD = 1e9+7;
struct UFDS {
vector<int> p; int cc;
UFDS(int n) : p(n,-1), cc(n) {}
int fin(int v) { return p[v] < 0 ? v : p[v] = fin(p[v]); }
bool join(int a, int b) {
a = fin(a), b = fin(b);
if (a == b) return false; --cc;
if (-p[a] < -p[b]) swap(a, b);
p[a] += p[b]; p[b] = a; return true;
}
};
void solve() {
int N; cin >> N;
vector<ar<int,2>> A(N);
for (auto &i : A) cin >> i[0] >> i[1];
UFDS ufds(N);
vector<int> g[N];
for (int i = 0; i < N; i++) {
for (int j = 0; j < i; j++) {
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

컴파일 시 표준 에러 (stderr) 메시지

port_facility.cpp: In member function 'bool UFDS::join(int64_t, int64_t)':
port_facility.cpp:17:9: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
   17 |         if (a == b) return false; --cc;
      |         ^~
port_facility.cpp:17:35: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
   17 |         if (a == b) return false; --cc;
      |                                   ^~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...