結果

問題 No.2043 Ohuton and Makura
ユーザー 👑 箱
提出日時 2022-04-24 03:02:05
言語 Kotlin
(1.9.23)
結果
AC  
実行時間 320 ms / 2,000 ms
コード長 1,015 bytes
コンパイル時間 14,359 ms
コンパイル使用メモリ 442,048 KB
実行使用メモリ 53,984 KB
最終ジャッジ日時 2023-10-20 07:30:41
合計ジャッジ時間 20,935 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 296 ms
53,868 KB
testcase_01 AC 297 ms
53,852 KB
testcase_02 AC 314 ms
53,980 KB
testcase_03 AC 314 ms
53,972 KB
testcase_04 AC 318 ms
53,984 KB
testcase_05 AC 315 ms
53,976 KB
testcase_06 AC 300 ms
53,960 KB
testcase_07 AC 311 ms
53,976 KB
testcase_08 AC 300 ms
53,960 KB
testcase_09 AC 308 ms
53,976 KB
testcase_10 AC 312 ms
53,968 KB
testcase_11 AC 310 ms
53,980 KB
testcase_12 AC 289 ms
53,864 KB
testcase_13 AC 289 ms
53,856 KB
testcase_14 AC 294 ms
53,868 KB
testcase_15 AC 296 ms
53,968 KB
testcase_16 AC 297 ms
53,972 KB
testcase_17 AC 303 ms
53,980 KB
testcase_18 AC 311 ms
53,972 KB
testcase_19 AC 320 ms
53,976 KB
testcase_20 AC 320 ms
53,972 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.PrintWriter
import java.util.*
import kotlin.math.*

fun PrintWriter.solve() {
    val a = nextLong()
    val b = nextLong()
    val s = nextLong()
    var ans = 0L
    for (x in 1..a) {
        for (y in 1..b) {
            if (x * y > s) break
            ans += (a - x + 1) * (b - y + 1)
        }
    }
    println(ans)
}

fun main() {
    Thread(null, {
        val writer = PrintWriter(System.out, false)
        writer.solve()
        writer.flush()
    }, "solve", abs(1L.shl(26)))
        .apply { setUncaughtExceptionHandler { _, e -> e.printStackTrace(); kotlin.system.exitProcess(1) } }
        .apply { start() }.join()
}

// region Scanner
private var st = StringTokenizer("")
private val br = System.`in`.bufferedReader()

fun next(): String {
    while (!st.hasMoreTokens()) st = StringTokenizer(br.readLine())
    return st.nextToken()
}

fun nextInt() = next().toInt()
fun nextLong() = next().toLong()
fun nextLine() = br.readLine()
fun nextDouble() = next().toDouble()
// endregion
0