結果

問題 No.682 Average
ユーザー asahi32942398asahi32942398
提出日時 2018-05-11 22:26:36
言語 Java19
(openjdk 21)
結果
AC  
実行時間 131 ms / 2,000 ms
コード長 315 bytes
コンパイル時間 3,965 ms
コンパイル使用メモリ 71,364 KB
実行使用メモリ 56,264 KB
最終ジャッジ日時 2023-09-10 12:50:24
合計ジャッジ時間 6,482 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 122 ms
55,980 KB
testcase_01 AC 123 ms
55,780 KB
testcase_02 AC 121 ms
55,572 KB
testcase_03 AC 120 ms
55,796 KB
testcase_04 AC 121 ms
56,264 KB
testcase_05 AC 122 ms
55,760 KB
testcase_06 AC 122 ms
55,680 KB
testcase_07 AC 123 ms
56,032 KB
testcase_08 AC 125 ms
55,724 KB
testcase_09 AC 130 ms
55,660 KB
testcase_10 AC 131 ms
55,860 KB
testcase_11 AC 121 ms
55,516 KB
testcase_12 AC 121 ms
55,532 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 answer=0;
    for(int i=a;i<=b;i++){
      if((a+b+i)%3==0){
        answer++;
      }
    }
    System.out.println(answer);
  }
}
0