hiho week 301 register

Ended

Participants:52

Verdict:Accepted
Score:100 / 100
Submitted:2020-04-05 18:12:35

Lang:Java

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
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;
class Main {
    private static final long TIMES = 1000000000;
    private static void help(Set<Long> setlong xlong y) {
        // System.out.println(x + ";" + y);
        long key = x * TIMES + y;
        if (set.contains(key))
            set.remove(key);
        else
            set.add(key);
    }
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int N = scanner.nextInt();
        Set<Long> set = new HashSet<>();
        for (int i = 0i < N++i) {
            long xi = scanner.nextInt();
            long yi = scanner.nextInt();
            help(setxiyi);
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX