MSBOP 2015 Round2B register

Ended

Participants:6187

Verdict:AC | AC
Submitted:2015-04-26 15:45:26

Lang:G++

Edit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include<algorithm>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<iostream>
using namespace std;
typedef int shuzu[1000001];
int T, idx, n, m, k, tot, zuixiaozhi,zuixiaodian, u, v, s[10000], xiayige[2000001], duimian[2000001];
long long ans;
bool vis[1000001], flag[1000001];
shuzu a, b, tou;
void paixu()
{
int i, j, t = 1;
for (i = 0; i < 2; i++)
{
memset(s, 0, sizeof(s));
for (j = 1; j <= n; j++)
s[a[j] / t % 10000]++;
for (j = 1; j < 10000; j++)
s[j] += s[j - 1];
for (j = n; j; j--)
b[s[a[j] / t % 10000]--] = a[j];
memcpy(a, b, sizeof(a));
t *= 10000;
}
}
void jiabian(int u, int v)
{
xiayige[++tot] = tou[u];
duimian[tot] = v;
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX