제출 #171422

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
1714222019-12-28 16:07:27dolphingarlic동기화 (JOI13_synchronization)C++14
100 / 100
952 ms23928 KiB
#include <bits/stdc++.h>
#define FOR(i, x, y) for (int i = x; i < y; i++)
#define x first
#define y second
using namespace std;
const int N = 200001;
vector<int> g[N];
pair<int, int> e[N];
int n, m, q, f[N], l[N], t = 1, tin[N], tout[N], c[N][20], b[N];
void dfs(int v = 1, int p = 0) {
c[v][0] = p;
for (int i = 1; i < 20 && c[v][i - 1]; i++) c[v][i] = c[c[v][i - 1]][i - 1];
f[v] = 1;
tin[v] = t++;
for (int i : g[v]) if (i != p) dfs(i, v);
tout[v] = t;
}
void up(int p, int val) { for (; p <= n; p += (p & (-p))) b[p] += val; }
int qu(int p) {
int ans = 0;
for (; p; p -= (p & (-p))) ans += b[p];
return ans;
}
int lca(int v) {
int ll = v;
for (int i = 19; ~i; i--) if (c[ll][i] && qu(tin[c[ll][i]]) == qu(tin[v])) ll = c[ll][i];
return ll;
}
main() {
cin >> n >> m >> q;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

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

synchronization.cpp:29:6: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
 main() {
      ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...