結果

問題 No.857 素振り
ユーザー Yosuke YamaguchiYosuke Yamaguchi
提出日時 2021-01-21 22:44:25
言語 Java21
(openjdk 21)
結果
AC  
実行時間 109 ms / 1,000 ms
コード長 576 bytes
コンパイル時間 2,851 ms
コンパイル使用メモリ 72,808 KB
実行使用メモリ 56,404 KB
最終ジャッジ日時 2023-08-26 14:12:59
合計ジャッジ時間 4,741 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 106 ms
56,404 KB
testcase_01 AC 106 ms
56,100 KB
testcase_02 AC 105 ms
55,772 KB
testcase_03 AC 106 ms
56,236 KB
testcase_04 AC 104 ms
55,712 KB
testcase_05 AC 106 ms
55,588 KB
testcase_06 AC 106 ms
56,040 KB
testcase_07 AC 109 ms
55,904 KB
testcase_08 AC 105 ms
56,096 KB
testcase_09 AC 106 ms
56,204 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

// https://yukicoder.me/problems/no/857
public class Suburi857 {
  public static void main(String[] args) {
    // 標準入力から読み込む際に、Scan
    Scanner sc = new Scanner(System.in);

    // String 1つ分を読み込む
    long x = Long.parseLong(sc.next());
    long y = Long.parseLong(sc.next());
    long z = Long.parseLong(sc.next());

    int rest = 0;
    if (z >= x)
      rest += 1;
    if (z >= y)
      rest += 1;

    long result = z - rest;
    if (result < 0)
      result = 0;
    System.out.println(result);
  }
}
0