-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain5.java
More file actions
25 lines (21 loc) · 805 Bytes
/
Main5.java
File metadata and controls
25 lines (21 loc) · 805 Bytes
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
import java.util.List;
import java.util.Scanner;
import java.util.stream.Stream;
import java.util.stream.Collectors;
import java.util.function.Supplier;
import cs2030.util.Pair;
import cs2030.simulator.Simulate5;
class Main5 {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
List<Pair<Double, Supplier<Double>>> inputTimes;
int numOfServers = sc.nextInt();
int numOfCustomers = sc.nextInt();
inputTimes = Stream.<Pair<Double, Supplier<Double>>>generate(() ->
Pair.of(sc.nextDouble(), () -> sc.nextDouble()))
.limit(numOfCustomers)
.collect(Collectors.toUnmodifiableList());
Simulate5 sim = new Simulate5(numOfServers, inputTimes);
System.out.println(sim.run());
}
}