結果

問題 No.682 Average
ユーザー GrenacheGrenache
提出日時 2018-05-11 22:22:03
言語 Java21
(openjdk 21)
結果
AC  
実行時間 127 ms / 2,000 ms
コード長 755 bytes
コンパイル時間 3,210 ms
コンパイル使用メモリ 72,636 KB
実行使用メモリ 57,520 KB
最終ジャッジ日時 2023-09-10 12:46:37
合計ジャッジ時間 5,799 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 125 ms
55,608 KB
testcase_01 AC 125 ms
55,408 KB
testcase_02 AC 123 ms
57,520 KB
testcase_03 AC 123 ms
55,684 KB
testcase_04 AC 124 ms
55,584 KB
testcase_05 AC 126 ms
55,536 KB
testcase_06 AC 127 ms
55,676 KB
testcase_07 AC 126 ms
55,580 KB
testcase_08 AC 126 ms
55,572 KB
testcase_09 AC 125 ms
55,524 KB
testcase_10 AC 126 ms
55,804 KB
testcase_11 AC 123 ms
55,736 KB
testcase_12 AC 123 ms
56,008 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.*;
import java.util.*;


public class Main_yukicoder682 {

	private static Scanner sc;
	private static Printer pr;

	private static void solve() {
		int a = sc.nextInt();
		int b = sc.nextInt();

		int cnt = 0;
		for (int i = a; i <= b; i++) {
			if ((a + i + b) % 3 == 0) {
				cnt++;
			}
		}

		pr.println(cnt);
	}

	// ---------------------------------------------------
	public static void main(String[] args) {
		sc = new Scanner(INPUT == null ? System.in : new ByteArrayInputStream(INPUT.getBytes()));
		pr = new Printer(System.out);

		solve();

//		pr.close();
		pr.flush();
//		sc.close();
	}

	static String INPUT = null;

	private static class Printer extends PrintWriter {
		Printer(OutputStream out) {
			super(out);
		}
	}
}
0