結果

問題 No.682 Average
ユーザー htensaihtensai
提出日時 2019-12-07 14:17:25
言語 Java21
(openjdk 21)
結果
AC  
実行時間 125 ms / 2,000 ms
コード長 384 bytes
コンパイル時間 3,699 ms
コンパイル使用メモリ 73,636 KB
実行使用メモリ 41,636 KB
最終ジャッジ日時 2024-06-07 13:09:55
合計ジャッジ時間 6,062 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 121 ms
41,636 KB
testcase_01 AC 117 ms
41,296 KB
testcase_02 AC 106 ms
40,132 KB
testcase_03 AC 119 ms
41,008 KB
testcase_04 AC 108 ms
40,128 KB
testcase_05 AC 117 ms
41,084 KB
testcase_06 AC 110 ms
40,376 KB
testcase_07 AC 103 ms
40,220 KB
testcase_08 AC 110 ms
39,972 KB
testcase_09 AC 119 ms
40,868 KB
testcase_10 AC 119 ms
41,080 KB
testcase_11 AC 118 ms
41,132 KB
testcase_12 AC 125 ms
41,028 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 count = 0;
        for (int i = a; i <= b; i++) {
            if ((a + b + i) % 3 == 0) {
                count++;
            }
        }
        System.out.println(count);
   }
}
0