This repository was archived by the owner on Feb 29, 2024. It is now read-only.
- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmeetings.java
More file actions
Latest commit
38 lines (36 loc) · 1004 Bytes
/
Copy pathmeetings.java
File metadata and controls
38 lines (36 loc) · 1004 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
26
27
28
29
30
31
32
33
34
35
36
37
38
importjava.io.*;
importjava.util.*;
publicclassmeetings {
publicstaticvoidmain(String[] args) throwsIOException{
// TODO Auto-generated method stub
BufferedReaderf= newBufferedReader(newFileReader("meetings.in"));
PrintWriterpw = newPrintWriter(newBufferedWriter(newFileWriter("meetings.in")));
intN, L;
StringTokenizerst = newStringTokenizer(f.readLine());
N = Integer.parseInt(st.nextToken());
L = Integer.parseInt(st.nextToken());
List<Cow> c = newArrayList<>();
for(inti = 0 ; i < N ; i++) {
intw = Integer.parseInt(st.nextToken());
intx = Integer.parseInt(st.nextToken());
intd = Integer.parseInt(st.nextToken());
c.add(newCow(x,d,w));
}
// Simulate
while(true) {
break; // Temporary to prevent infinite loop
}
pw.close();
f.close();
}
}
classCow{
intpos;
intvelocity;
intweight;
publicCow(intpos, intv, intw) {
this.weight = w;
this.velocity = v;
this.pos = pos;
}
}