結果

問題 No.1926 Sequence of Remainders
ユーザー 👑 箱
提出日時 2022-05-16 21:09:10
言語 Kotlin
(1.9.23)
結果
AC  
実行時間 718 ms / 2,000 ms
コード長 990 bytes
コンパイル時間 18,993 ms
コンパイル使用メモリ 418,772 KB
実行使用メモリ 61,544 KB
最終ジャッジ日時 2023-10-12 15:32:36
合計ジャッジ時間 48,306 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 290 ms
47,576 KB
testcase_01 AC 600 ms
55,932 KB
testcase_02 AC 618 ms
55,868 KB
testcase_03 AC 612 ms
59,132 KB
testcase_04 AC 584 ms
55,872 KB
testcase_05 AC 603 ms
56,392 KB
testcase_06 AC 624 ms
56,412 KB
testcase_07 AC 683 ms
56,060 KB
testcase_08 AC 636 ms
56,176 KB
testcase_09 AC 635 ms
56,152 KB
testcase_10 AC 621 ms
56,240 KB
testcase_11 AC 666 ms
56,488 KB
testcase_12 AC 661 ms
56,444 KB
testcase_13 AC 650 ms
57,600 KB
testcase_14 AC 641 ms
56,248 KB
testcase_15 AC 635 ms
56,120 KB
testcase_16 AC 628 ms
59,120 KB
testcase_17 AC 661 ms
59,180 KB
testcase_18 AC 636 ms
60,088 KB
testcase_19 AC 636 ms
61,544 KB
testcase_20 AC 647 ms
59,112 KB
testcase_21 AC 628 ms
60,620 KB
testcase_22 AC 642 ms
58,020 KB
testcase_23 AC 625 ms
58,292 KB
testcase_24 AC 640 ms
59,452 KB
testcase_25 AC 637 ms
58,252 KB
testcase_26 AC 632 ms
58,848 KB
testcase_27 AC 633 ms
58,612 KB
testcase_28 AC 625 ms
58,056 KB
testcase_29 AC 665 ms
60,384 KB
testcase_30 AC 635 ms
58,024 KB
testcase_31 AC 630 ms
60,212 KB
testcase_32 AC 621 ms
60,020 KB
testcase_33 AC 661 ms
60,120 KB
testcase_34 AC 718 ms
60,284 KB
testcase_35 AC 634 ms
58,568 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

fun PrintWriter.solve() {
    val numCases = nextInt()
    case@ for (_i in 0 until numCases) {
        val n = nextInt()
        val m = nextInt()
        val k = nextInt()
        val a0 = k % m
        println(if (a0 < m - n) a0 else 0)
    }
}

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