hiho week 195 register

Ended

Participants:264

Verdict:Accepted
Score:100 / 100
Submitted:2018-03-30 21:44:16

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 <cmath>
#include <algorithm>
#include <string.h>
#include <malloc.h>
using namespace std;
#define maxn 100500
int W[maxn];
int P[maxn];
int NW[maxn];
int NP[maxn];
int NN;
int dp[maxn];
int cnt[11][11];
int main()
{
    int N, M;
    cin >> N >> M;
    memset(cnt, 0, sizeof(int) * 11 * 11);
    for (int i = 0; i < N; i++) {
        cin >> W[i] >> P[i];
        cnt[W[i]][P[i]] ++; 
    }
    NN = 0;  
    for (int i = 0; i < 11; i++) {
        for (int j = 0; j < 11; j++) {
            if (cnt[i][j] > 0) {
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX