File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
src/main/java/greedy/silver/silver_5 Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change 44import java .util .StringTokenizer ;
55
66public class _25707 {
7+
78 public static void main (String [] args ) throws IOException {
89 BufferedReader br = new BufferedReader (new InputStreamReader (System .in ));
910 BufferedWriter bw = new BufferedWriter (new OutputStreamWriter (System .out ));
@@ -15,16 +16,15 @@ public static void main(String[] args) throws IOException {
1516 int max = Integer .MIN_VALUE ;
1617
1718 st = new StringTokenizer (br .readLine ());
18-
1919 for (int i = 0 ; i < n ; i ++) {
2020 int bead = Integer .parseInt (st .nextToken ());
21-
2221 min = Math .min (min , bead );
2322 max = Math .max (max , bead );
2423 }
2524
26- bw .write (String .valueOf (2 * (max - min )));
25+ bw .write (String .valueOf ((max - min ) * 2 ));
2726 bw .flush ();
2827 bw .close ();
2928 }
29+
3030}
You can’t perform that action at this time.
0 commit comments