编号 题目 状态 分数 总时间 内存 代码 / 答案文件 提交者 提交时间
#6158 #1018. 进击的辉夜 Accepted 100 31 ms 540 K C++ 17 / 571 B C192022211986 2023-10-14 18:33:18
显示原始代码
// Created on iPad.
#include <iostream>
#include <cstdio>
#include <cstring>
#include <map>
#include <vector>
#include <algorithm>

using namespace std;

const int N = 1e6 + 10;

int mp[N];
int n;
void solve() {
    cin >> n;
    for (int i = 1; i <= n; i++) {
        int x;
        cin >> x;
        mp[x]++;
    }
    int res = 0;
    for (int i = 1; i <= N; i++) res += mp[i] / 2;
    cout << res << endl;
    return;
}

int main() {
    int T = 1;
    // cin >> T;
    while (T--) {
        solve();
    }
    return 0;
}
子任务 #1
Accepted
得分:100
测试点 #1
Accepted
得分:100
用时:6 ms
内存:336 KiB

输入文件(1.in

6
4 1 7 4 1 4

答案文件(1.out

2

用户输出

2

系统信息

Exited with return code 0
测试点 #2
Accepted
得分:100
用时:6 ms
内存:328 KiB

输入文件(2.in

1
100

答案文件(2.out

0

用户输出

0

系统信息

Exited with return code 0
测试点 #3
Accepted
得分:100
用时:6 ms
内存:328 KiB

输入文件(3.in

10
295 2 29 295 29 2 29 295 2 29

答案文件(3.out

4

用户输出

4

系统信息

Exited with return code 0
测试点 #4
Accepted
得分:100
用时:7 ms
内存:540 KiB

输入文件(4.in

500
20791
16246
12023
32102
6194
24243
2797
31161
15065
22300
2777
8126
13228
5952
22
<3250 bytes omitted>

答案文件(4.out

5

用户输出

5

系统信息

Exited with return code 0
测试点 #5
Accepted
得分:100
用时:6 ms
内存:448 KiB

输入文件(5.in

1000
21330
20261
10492
4853
4163
16794
24832
6913
19734
23677
11141
15394
28894
16352
<6611 bytes omitted>

答案文件(5.out

13

用户输出

13

系统信息

Exited with return code 0