結果

問題 No.2043 Ohuton and Makura
ユーザー ks2mks2m
提出日時 2022-08-19 22:00:35
言語 Java21
(openjdk 21)
結果
AC  
実行時間 82 ms / 2,000 ms
コード長 660 bytes
コンパイル時間 2,487 ms
コンパイル使用メモリ 73,600 KB
実行使用メモリ 38,844 KB
最終ジャッジ日時 2024-04-17 00:43:31
合計ジャッジ時間 4,190 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 52 ms
36,936 KB
testcase_01 AC 51 ms
37,304 KB
testcase_02 AC 63 ms
37,564 KB
testcase_03 AC 52 ms
37,220 KB
testcase_04 AC 74 ms
37,824 KB
testcase_05 AC 75 ms
37,940 KB
testcase_06 AC 58 ms
37,180 KB
testcase_07 AC 77 ms
37,940 KB
testcase_08 AC 57 ms
36,828 KB
testcase_09 AC 74 ms
37,596 KB
testcase_10 AC 74 ms
37,728 KB
testcase_11 AC 75 ms
38,844 KB
testcase_12 AC 51 ms
37,188 KB
testcase_13 AC 50 ms
36,772 KB
testcase_14 AC 52 ms
37,216 KB
testcase_15 AC 76 ms
38,152 KB
testcase_16 AC 75 ms
37,700 KB
testcase_17 AC 74 ms
37,940 KB
testcase_18 AC 52 ms
37,164 KB
testcase_19 AC 81 ms
37,880 KB
testcase_20 AC 82 ms
38,232 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {
	public static void main(String[] args) throws Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String[] sa = br.readLine().split(" ");
		int a = Integer.parseInt(sa[0]);
		int b = Integer.parseInt(sa[1]);
		int s = Integer.parseInt(sa[2]);
		br.close();

		long ans = 0;
		for (int x = 1; x <= a; x++) {
			int ym = Math.min(s / x, b);
			long v1 = a - x + 1;
			long v21 = (long) b * (b + 1) / 2;
			long r = b - ym;
			long v22 = r * (r + 1) / 2;
			long val = v1 * (v21 - v22);
			ans += val;
		}
		System.out.println(ans);
	}
}
0