結果

問題 No.1926 Sequence of Remainders
ユーザー tentententen
提出日時 2022-05-09 13:57:50
言語 Java21
(openjdk 21)
結果
AC  
実行時間 369 ms / 2,000 ms
コード長 1,280 bytes
コンパイル時間 3,476 ms
コンパイル使用メモリ 74,484 KB
実行使用メモリ 61,068 KB
最終ジャッジ日時 2023-09-23 12:42:36
合計ジャッジ時間 23,828 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 43 ms
49,540 KB
testcase_01 AC 308 ms
58,360 KB
testcase_02 AC 289 ms
58,556 KB
testcase_03 AC 299 ms
58,424 KB
testcase_04 AC 285 ms
58,500 KB
testcase_05 AC 295 ms
58,568 KB
testcase_06 AC 351 ms
58,700 KB
testcase_07 AC 353 ms
59,096 KB
testcase_08 AC 353 ms
58,800 KB
testcase_09 AC 353 ms
58,804 KB
testcase_10 AC 351 ms
59,120 KB
testcase_11 AC 355 ms
59,032 KB
testcase_12 AC 352 ms
59,108 KB
testcase_13 AC 342 ms
58,864 KB
testcase_14 AC 359 ms
59,160 KB
testcase_15 AC 345 ms
58,032 KB
testcase_16 AC 344 ms
58,732 KB
testcase_17 AC 348 ms
59,144 KB
testcase_18 AC 352 ms
59,036 KB
testcase_19 AC 347 ms
59,048 KB
testcase_20 AC 353 ms
59,116 KB
testcase_21 AC 351 ms
58,660 KB
testcase_22 AC 359 ms
59,272 KB
testcase_23 AC 347 ms
57,572 KB
testcase_24 AC 353 ms
58,868 KB
testcase_25 AC 349 ms
58,820 KB
testcase_26 AC 358 ms
60,664 KB
testcase_27 AC 351 ms
60,692 KB
testcase_28 AC 354 ms
60,500 KB
testcase_29 AC 357 ms
61,068 KB
testcase_30 AC 357 ms
60,624 KB
testcase_31 AC 355 ms
60,432 KB
testcase_32 AC 356 ms
60,436 KB
testcase_33 AC 369 ms
60,260 KB
testcase_34 AC 364 ms
60,256 KB
testcase_35 AC 355 ms
60,508 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner();
        int t = sc.nextInt();
        StringBuilder sb = new StringBuilder();
        while (t-- > 0) {
            int n = sc.nextInt();
            int m = sc.nextInt();
            long k = sc.nextLong();
            long first = k % m;
            if (first < m - n) {
                sb.append(first).append("\n");
            } else {
                sb.append("0\n");
            }
        }
        System.out.print(sb);
    }
}

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 {
        if (!st.hasMoreTokens()) {
            st = new StringTokenizer(br.readLine());
        }
        return st.nextToken();
    }
}
0