結果

問題 No.682 Average
ユーザー sudo_yum
提出日時 2018-06-06 14:08:32
言語 Java
(openjdk 23)
結果
AC  
実行時間 132 ms / 2,000 ms
コード長 416 bytes
コンパイル時間 2,176 ms
コンパイル使用メモリ 74,372 KB
実行使用メモリ 54,264 KB
最終ジャッジ日時 2024-06-30 10:14:48
合計ジャッジ時間 4,574 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 13
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main{
  static StringBuilder sb = new StringBuilder("");
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int A = sc.nextInt();
    int B = sc.nextInt();
    int I = A;
    int k =0;
    for (int i = A;i <= B ;i++ ) {
      if ((A+B+I)%3==0) {
        k++;
        I++;
      }else{
        I++;
      }
    }
    System.out.println(k);
  }
}
0