結果

問題 No.682 Average
ユーザー YamaKasa
提出日時 2018-06-07 00:01:41
言語 Java
(openjdk 23)
結果
AC  
実行時間 131 ms / 2,000 ms
コード長 356 bytes
コンパイル時間 1,980 ms
コンパイル使用メモリ 74,228 KB
実行使用メモリ 41,648 KB
最終ジャッジ日時 2024-06-30 10:25:02
合計ジャッジ時間 4,369 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 13
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int A = scan.nextInt();
		int B = scan.nextInt();
		scan.close();
		int sum = A + B;
		int cnt = 0;
		for(int i = A; i <= B; i++) {
			int k = sum + i;
			if(k % 3 == 0) {
				cnt ++;
			}
		}
		System.out.println(cnt);
	}
}
0