結果

問題 No.682 Average
ユーザー tentententen
提出日時 2020-09-03 20:15:31
言語 Java21
(openjdk 21)
結果
AC  
実行時間 108 ms / 2,000 ms
コード長 350 bytes
コンパイル時間 2,298 ms
コンパイル使用メモリ 71,728 KB
実行使用メモリ 56,228 KB
最終ジャッジ日時 2023-08-15 16:26:51
合計ジャッジ時間 4,920 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 106 ms
55,760 KB
testcase_01 AC 107 ms
56,172 KB
testcase_02 AC 108 ms
56,116 KB
testcase_03 AC 105 ms
56,116 KB
testcase_04 AC 103 ms
55,760 KB
testcase_05 AC 104 ms
55,784 KB
testcase_06 AC 105 ms
56,008 KB
testcase_07 AC 105 ms
56,228 KB
testcase_08 AC 106 ms
55,672 KB
testcase_09 AC 107 ms
54,360 KB
testcase_10 AC 106 ms
55,804 KB
testcase_11 AC 108 ms
55,680 KB
testcase_12 AC 106 ms
55,764 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