結果

問題 No.682 Average
ユーザー takeya_okinotakeya_okino
提出日時 2018-05-12 20:46:14
言語 Java19
(openjdk 21)
結果
AC  
実行時間 121 ms / 2,000 ms
コード長 306 bytes
コンパイル時間 2,488 ms
コンパイル使用メモリ 72,004 KB
実行使用メモリ 56,260 KB
最終ジャッジ日時 2023-09-10 18:31:49
合計ジャッジ時間 4,925 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 121 ms
55,560 KB
testcase_01 AC 121 ms
55,828 KB
testcase_02 AC 121 ms
56,104 KB
testcase_03 AC 120 ms
55,824 KB
testcase_04 AC 121 ms
55,784 KB
testcase_05 AC 121 ms
56,260 KB
testcase_06 AC 120 ms
55,516 KB
testcase_07 AC 121 ms
55,832 KB
testcase_08 AC 121 ms
55,860 KB
testcase_09 AC 121 ms
55,908 KB
testcase_10 AC 119 ms
55,528 KB
testcase_11 AC 119 ms
55,512 KB
testcase_12 AC 119 ms
55,752 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 ans = 0;
    for(int i = a; i <= b; i++) {
      if((a + b + i) % 3 == 0) ans++;
    }
    System.out.println(ans);
  }
}
0