結果

問題 No.810 割った余りの個数
ユーザー tentententen
提出日時 2020-09-01 07:25:54
言語 Java21
(openjdk 21)
結果
AC  
実行時間 125 ms / 2,000 ms
コード長 352 bytes
コンパイル時間 2,089 ms
コンパイル使用メモリ 70,968 KB
実行使用メモリ 56,280 KB
最終ジャッジ日時 2023-08-11 02:56:21
合計ジャッジ時間 7,864 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 122 ms
55,804 KB
testcase_01 AC 124 ms
55,676 KB
testcase_02 AC 125 ms
55,948 KB
testcase_03 AC 122 ms
55,972 KB
testcase_04 AC 124 ms
55,808 KB
testcase_05 AC 121 ms
55,756 KB
testcase_06 AC 124 ms
55,804 KB
testcase_07 AC 122 ms
55,804 KB
testcase_08 AC 122 ms
55,704 KB
testcase_09 AC 125 ms
55,528 KB
testcase_10 AC 120 ms
55,772 KB
testcase_11 AC 121 ms
55,796 KB
testcase_12 AC 123 ms
55,744 KB
testcase_13 AC 122 ms
55,796 KB
testcase_14 AC 119 ms
55,480 KB
testcase_15 AC 120 ms
56,280 KB
testcase_16 AC 122 ms
56,128 KB
testcase_17 AC 124 ms
55,748 KB
testcase_18 AC 123 ms
55,536 KB
testcase_19 AC 125 ms
55,972 KB
testcase_20 AC 122 ms
55,764 KB
testcase_21 AC 123 ms
55,728 KB
testcase_22 AC 121 ms
55,740 KB
testcase_23 AC 125 ms
55,768 KB
testcase_24 AC 125 ms
55,676 KB
testcase_25 AC 125 ms
56,032 KB
testcase_26 AC 124 ms
55,896 KB
testcase_27 AC 124 ms
56,096 KB
testcase_28 AC 124 ms
55,792 KB
testcase_29 AC 125 ms
55,700 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
	public static void main (String[] args) {
    	Scanner sc = new Scanner(System.in);
    	int a = sc.nextInt();
    	int b = sc.nextInt();
    	int c = sc.nextInt();
    	if (b - a + 1 >= c) {
    	    System.out.println(c);
    	} else {
    	    System.out.println((b % c - (a - 1) % c + c) % c);
    	}
	}
}
0