結果

問題 No.2043 Ohuton and Makura
ユーザー tentententen
提出日時 2022-08-22 10:26:35
言語 Java21
(openjdk 21)
結果
AC  
実行時間 81 ms / 2,000 ms
コード長 1,171 bytes
コンパイル時間 2,598 ms
コンパイル使用メモリ 76,892 KB
実行使用メモリ 38,024 KB
最終ジャッジ日時 2024-04-18 13:20:29
合計ジャッジ時間 4,782 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 52 ms
37,116 KB
testcase_01 AC 50 ms
37,108 KB
testcase_02 AC 73 ms
38,024 KB
testcase_03 AC 68 ms
37,704 KB
testcase_04 AC 78 ms
37,864 KB
testcase_05 AC 73 ms
37,672 KB
testcase_06 AC 66 ms
37,976 KB
testcase_07 AC 72 ms
37,924 KB
testcase_08 AC 67 ms
37,912 KB
testcase_09 AC 72 ms
37,952 KB
testcase_10 AC 76 ms
37,704 KB
testcase_11 AC 72 ms
37,636 KB
testcase_12 AC 50 ms
37,040 KB
testcase_13 AC 50 ms
37,208 KB
testcase_14 AC 50 ms
37,184 KB
testcase_15 AC 62 ms
37,268 KB
testcase_16 AC 62 ms
37,440 KB
testcase_17 AC 69 ms
37,820 KB
testcase_18 AC 68 ms
37,736 KB
testcase_19 AC 81 ms
37,628 KB
testcase_20 AC 78 ms
37,672 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner();
        int a = sc.nextInt();
        int b = sc.nextInt();
        int s = sc.nextInt();
        long ans = 0;
        for (int i = 1; i <= a; i++) {
            for (int j = 1; j <= b && i * j <= s; j++) {
                ans += (a - i + 1L) * (b - j + 1L);
            }
        }
        System.out.println(ans);
    }
}

class Scanner {
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    StringTokenizer st = new StringTokenizer("");
    
    public Scanner() throws Exception {
        
    }
    
    public int nextInt() throws Exception {
        return Integer.parseInt(next());
    }
    
    public long nextLong() throws Exception {
        return Long.parseLong(next());
    }
    
    public double nextDouble() throws Exception {
        return Double.parseDouble(next());
    }
    
    public String next() throws Exception {
        while (!st.hasMoreTokens()) {
            st = new StringTokenizer(br.readLine());
        }
        return st.nextToken();
    }
}
0