File tree Expand file tree Collapse file tree 2 files changed +28
-2
lines changed Expand file tree Collapse file tree 2 files changed +28
-2
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,8 @@ Owen's Algorithm Problem Solving Note
8
8
9
9
#### Round D
10
10
11
+ 1 . Record Breaker / Array Sort / AC / 2021.01.01
12
+
11
13
#### Round E
12
14
13
15
#### Round F
Original file line number Diff line number Diff line change
1
+ import java .io .*;
2
+ import java .util .*;
3
+
1
4
public class Kickstart_2020_D_1 {
2
- public static void main (String [] args ) {
3
- System .out .println ("Hello World" );
5
+ public static void main (String [] args ) throws IOException {
6
+ BufferedReader br = new BufferedReader (new InputStreamReader (System .in ));
7
+ StringTokenizer st = new StringTokenizer (br .readLine ());
8
+ int T = Integer .parseInt (st .nextToken ());
9
+ for (int i = 1 ; i <= T ; i ++) {
10
+ int N = Integer .parseInt (br .readLine ());
11
+ int [] arr = new int [N ];
12
+ int max = -1 ;
13
+ st = new StringTokenizer (br .readLine ());
14
+ int cnt = 0 ;
15
+ for (int j = 0 ; j < N ; j ++) {
16
+ arr [j ] = Integer .parseInt (st .nextToken ());
17
+ }
18
+ for (int j = 0 ; j < N ; j ++) {
19
+ if (j == N -1 ) {
20
+ if (arr [j ] > max ) cnt ++;
21
+ } else {
22
+ if (arr [j ] > max && arr [j ] > arr [j +1 ]) cnt ++;
23
+ }
24
+ max = Math .max (arr [j ], max );
25
+ }
26
+ System .out .println ("Case #" + i + ": " + cnt );
27
+ }
4
28
}
5
29
}
You can’t perform that action at this time.
0 commit comments