結果

問題 No.857 素振り
ユーザー tentententen
提出日時 2020-08-31 15:32:42
言語 Java21
(openjdk 21)
結果
AC  
実行時間 118 ms / 1,000 ms
コード長 393 bytes
コンパイル時間 1,620 ms
コンパイル使用メモリ 73,768 KB
実行使用メモリ 54,172 KB
最終ジャッジ日時 2024-04-27 19:33:54
合計ジャッジ時間 3,262 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 108 ms
53,464 KB
testcase_01 AC 98 ms
52,632 KB
testcase_02 AC 106 ms
54,040 KB
testcase_03 AC 108 ms
54,172 KB
testcase_04 AC 106 ms
53,780 KB
testcase_05 AC 98 ms
52,548 KB
testcase_06 AC 109 ms
54,044 KB
testcase_07 AC 101 ms
53,520 KB
testcase_08 AC 105 ms
52,524 KB
testcase_09 AC 118 ms
53,628 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
	public static void main (String[] args) {
    	Scanner sc = new Scanner(System.in);
    	long x = sc.nextLong();
    	long y = sc.nextLong();
    	long z = sc.nextLong();
    	long ans;
    	if (y <= z) {
    	    ans = z - 2;
    	} else if (x <= z) {
    	    ans = z - 1;
    	} else {
    	    ans = z;
    	}
    	System.out.println(ans);
    }
}
0