Home AtCoder. ABC 235 B Climbing Takahashi
Post
Cancel

AtCoder. ABC 235 B Climbing Takahashi

[Link] https://AtCoder.jp/contests/abc235/tasks/abc235_b

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
import java.util.*;
import java.io.*;

public class Main {
	static BufferedReader br;
	static int max = 0, maxIdx = 0;
	public static void main(String[] args) throws IOException {
		br = new BufferedReader(new InputStreamReader(System.in));
		int n = toi(br.readLine());
		String[] line = getLine();
		int val = 0;
		for(int i = 0; i < n; i++) {
			if(val < toi(line[i])) val = toi(line[i]);
			else break;
		}
		println(val);
	}

	static int sum(int a, int b, int c) {
		return 100 * a + 10 * b + c;
	}


	static int toi(String s) { return Integer.parseInt(s); }
	static String[] getLine() throws IOException { return br.readLine().split(" "); }
	static <T> void println(T s) { System.out.println(s); }
}
This post is licensed under CC BY 4.0 by the author.