hiho week 81 register

Ended

Participants:133

Verdict:Accepted
Score:100 / 100
Submitted:2016-01-17 15:27:47

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 <iostream>
#include <algorithm>
#include <queue>
#include <vector>
#include <map>
using namespace std;
const int N = 110000;
const int M = N;
struct Graph{
    vector<int> head, ne, t,in,exis;
    int tot;
    Graph(int n, int m) :head(n), ne(m), t(m),in(n),exis(n),tot(0) {}
    inline void addedge(int p, int q) {
        tot++;
        ne[tot] = head[p]; head[p] = tot; t[tot] = q; in[q]++;
        exis[p] = exis[q] = 1;
    }
};
void solve() {
    Graph g(N * 2, N * 10);
    vector<int>  ans(N + M);
    int n, m;
    cin >> n >> m;
    queue<int> q;
    for (int i = 0; i < m; i++) {
        int k; cin >> k; ans[k+n]++;
    }
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX