結果

問題 No.2648 [Cherry 6th Tune D] 一次元の馬
ユーザー ks2mks2m
提出日時 2024-02-23 21:28:16
言語 Java21
(openjdk 21)
結果
AC  
実行時間 405 ms / 2,000 ms
コード長 717 bytes
コンパイル時間 2,401 ms
コンパイル使用メモリ 74,516 KB
実行使用メモリ 76,644 KB
最終ジャッジ日時 2024-02-23 21:28:32
合計ジャッジ時間 14,963 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 50 ms
54,128 KB
testcase_01 AC 293 ms
62,148 KB
testcase_02 AC 305 ms
61,392 KB
testcase_03 AC 319 ms
61,588 KB
testcase_04 AC 316 ms
70,540 KB
testcase_05 AC 312 ms
73,468 KB
testcase_06 AC 309 ms
68,008 KB
testcase_07 AC 350 ms
76,644 KB
testcase_08 AC 315 ms
67,264 KB
testcase_09 AC 305 ms
72,320 KB
testcase_10 AC 308 ms
73,412 KB
testcase_11 AC 298 ms
68,168 KB
testcase_12 AC 337 ms
72,668 KB
testcase_13 AC 327 ms
73,708 KB
testcase_14 AC 310 ms
71,964 KB
testcase_15 AC 290 ms
71,956 KB
testcase_16 AC 303 ms
71,748 KB
testcase_17 AC 291 ms
69,572 KB
testcase_18 AC 293 ms
72,200 KB
testcase_19 AC 290 ms
72,088 KB
testcase_20 AC 287 ms
72,248 KB
testcase_21 AC 299 ms
72,212 KB
testcase_22 AC 289 ms
71,852 KB
testcase_23 AC 286 ms
71,808 KB
testcase_24 AC 292 ms
71,908 KB
testcase_25 AC 273 ms
67,296 KB
testcase_26 AC 288 ms
71,856 KB
testcase_27 AC 325 ms
68,836 KB
testcase_28 AC 286 ms
71,780 KB
testcase_29 AC 335 ms
75,784 KB
testcase_30 AC 289 ms
72,072 KB
testcase_31 AC 299 ms
72,600 KB
testcase_32 AC 296 ms
72,396 KB
testcase_33 AC 310 ms
72,724 KB
testcase_34 AC 290 ms
71,872 KB
testcase_35 AC 405 ms
61,404 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.PrintWriter;

public class Main {
	public static void main(String[] args) throws Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int t = Integer.parseInt(br.readLine());
		PrintWriter pw = new PrintWriter(System.out);
		for (int z = 0; z < t; z++) {
			int n = Integer.parseInt(br.readLine());
			String[] sa = br.readLine().split(" ");
			int[] a = new int[n];
			for (int i = 0; i < n; i++) {
				a[i] = Integer.parseInt(sa[i]);
			}

			int max = -1;
			for (int i = 1; i < n; i++) {
				max = Math.max(max, a[i - 1] - a[i]);
			}
			pw.println(max + 1);
		}
		pw.flush();
		br.close();
	}
}
0