-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtemplate.java
32 lines (24 loc) · 839 Bytes
/
template.java
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
import java.io.*;
import java.util.*;
class Main {
static private final String INPUT = "input.txt"; // address of the input file in inverted commas
static private final String OUTPUT = "output.txt"; //address of the output file in inverted commmas
public static void main(String[] args) {
long startTime = System.nanoTime() / 1000000000;
FileInputStream instream = null;
PrintStream outstream = null;
try {
instream = new FileInputStream(INPUT);
outstream = new PrintStream(new FileOutputStream(OUTPUT));
System.setIn(instream);
System.setOut(outstream);
} catch (Exception e) {
System.err.println("Error");
}
Scanner s = new Scanner(System.in);
double endTime = System.nanoTime() / 1000000000;
double totalTime = endTime - startTime;
System.err.format("%.8f\n", totalTime);
return;
}
}