結果

問題 No.682 Average
ユーザー matsuyoshi30matsuyoshi30
提出日時 2018-05-11 22:23:12
言語 Java21
(openjdk 21)
結果
AC  
実行時間 127 ms / 2,000 ms
コード長 351 bytes
コンパイル時間 2,224 ms
コンパイル使用メモリ 72,720 KB
実行使用メモリ 56,044 KB
最終ジャッジ日時 2023-09-10 12:47:46
合計ジャッジ時間 5,001 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 123 ms
55,728 KB
testcase_01 AC 126 ms
56,044 KB
testcase_02 AC 127 ms
55,880 KB
testcase_03 AC 126 ms
55,748 KB
testcase_04 AC 126 ms
55,804 KB
testcase_05 AC 124 ms
55,748 KB
testcase_06 AC 124 ms
55,932 KB
testcase_07 AC 124 ms
55,776 KB
testcase_08 AC 125 ms
55,972 KB
testcase_09 AC 124 ms
55,496 KB
testcase_10 AC 125 ms
55,864 KB
testcase_11 AC 124 ms
55,676 KB
testcase_12 AC 124 ms
56,016 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int a = in.nextInt();
        int b = in.nextInt();

        int count = 0;
        for(int i=a; i<=b; i++) {
            if((i+a+b)%3 == 0)
                count++;
        }

        System.out.println(count);
    }
}
0