CSES - HIIT Open 2018 - Results
Submission details
Task:Data Packet Routing
Sender:El Numero Uno
Submission time:2018-05-26 15:47:21 +0300
Language:Java
Status:READY
Result:
Test results
testverdicttime
#1ACCEPTED0.29 sdetails
#2--details
#3--details
#4--details
#50.73 sdetails
#60.47 sdetails
#70.42 sdetails
#8ACCEPTED0.31 sdetails
#9ACCEPTED0.32 sdetails

Code

import java.util.*;

public class d {

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		String s;
		
		int c = Integer.parseInt(in.nextLine());
		for (int i = 0; i < c; i++) {
			Map<String, Integer> d = new HashMap<>();
			int k = Integer.parseInt(in.nextLine().split(" ")[1]);
			for (int j = 0; j < k; j++) {
				s = in.nextLine();
				if (d.containsKey(s)) d.put(s, d.get(s) + 1);
				else d.put(s, 1);
			}
			System.out.println(d.values().stream().max(Comparator.naturalOrder()).get());
		}
		
	
		
		
	}
	
}

Test details

Test 1

Verdict: ACCEPTED

input
2
10 3
1 2
2 1
3 4
...

correct output
1
2

user output
1
2

Test 2

Verdict:

input
10
400 100000
292 392
33 131
61 254
...

correct output
2
2
2
2
2
...

user output
(empty)

Test 3

Verdict:

input
10
700 100000
603 318
570 280
374 589
...

correct output
2
2
2
2
2
...

user output
(empty)

Test 4

Verdict:

input
10
1000 100000
612 150
630 797
925 44
...

correct output
2
2
2
2
2
...

user output
(empty)

Test 5

Verdict:

input
10
1000 10000
25 713
450 653
659 325
...

correct output
2
2
2
2
2
...

user output
2
2
3
2
2
...

Test 6

Verdict:

input
10
1000 3000
804 754
634 483
331 476
...

correct output
2
2
2
2
2
...

user output
2
3
3
2
3
...

Test 7

Verdict:

input
10
1000 1000
529 538
501 784
783 645
...

correct output
2
2
2
2
2
...

user output
3
2
2
2
2
...

Test 8

Verdict: ACCEPTED

input
10
1000 300
602 710
622 952
254 471
...

correct output
1
2
2
1
1
...

user output
1
2
2
1
1
...

Test 9

Verdict: ACCEPTED

input
10
1000 100
295 836
509 67
436 838
...

correct output
1
1
1
1
1
...

user output
1
1
1
1
1
...