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 32 33 34 35 36 37
|
#include <cstdio> #include <map> #include <iostream> using namespace std; const int N = 1e4 + 66;
int n, p, h, m; int d[N], c[N]; map<pair<int,int>, bool>existed;
inline int youngore() { int i; scanf ("%d%d%d%d", &n, &p, &h, &m); for (i = 1; i <= m; ++ i) { int x, y; scanf ("%d%d", &x, &y); if (x > y) swap(x, y); if (existed[make_pair(x, y)]) continue; existed[make_pair(x, y)] = true; d[x + 1] -= 1, d[y] += 1; } for (i = 1; i <= n; ++ i) { c[i] = c[i - 1] + d[i]; printf ("%d\n", h + c[i]); } return 0; }
int thestars = youngore();
signed main() {;}
|