結果

問題 No.1926 Sequence of Remainders
ユーザー mnmmnm
提出日時 2022-06-05 14:52:59
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 269 ms / 2,000 ms
コード長 611 bytes
コンパイル時間 746 ms
コンパイル使用メモリ 78,176 KB
実行使用メモリ 8,912 KB
最終ジャッジ日時 2023-10-21 03:11:38
合計ジャッジ時間 12,716 ms
ジャッジサーバーID
(参考情報)
judge9 / judge10
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,348 KB
testcase_01 AC 198 ms
8,912 KB
testcase_02 AC 196 ms
8,912 KB
testcase_03 AC 194 ms
8,912 KB
testcase_04 AC 201 ms
8,912 KB
testcase_05 AC 201 ms
8,912 KB
testcase_06 AC 266 ms
8,912 KB
testcase_07 AC 266 ms
8,912 KB
testcase_08 AC 266 ms
8,912 KB
testcase_09 AC 264 ms
8,912 KB
testcase_10 AC 262 ms
8,912 KB
testcase_11 AC 264 ms
8,912 KB
testcase_12 AC 263 ms
8,912 KB
testcase_13 AC 263 ms
8,912 KB
testcase_14 AC 265 ms
8,912 KB
testcase_15 AC 264 ms
8,912 KB
testcase_16 AC 265 ms
8,912 KB
testcase_17 AC 264 ms
8,912 KB
testcase_18 AC 264 ms
8,912 KB
testcase_19 AC 266 ms
8,912 KB
testcase_20 AC 264 ms
8,912 KB
testcase_21 AC 260 ms
8,912 KB
testcase_22 AC 264 ms
8,912 KB
testcase_23 AC 264 ms
8,912 KB
testcase_24 AC 263 ms
8,912 KB
testcase_25 AC 262 ms
8,912 KB
testcase_26 AC 266 ms
8,912 KB
testcase_27 AC 269 ms
8,912 KB
testcase_28 AC 265 ms
8,912 KB
testcase_29 AC 266 ms
8,912 KB
testcase_30 AC 269 ms
8,912 KB
testcase_31 AC 266 ms
8,912 KB
testcase_32 AC 268 ms
8,912 KB
testcase_33 AC 266 ms
8,912 KB
testcase_34 AC 266 ms
8,912 KB
testcase_35 AC 266 ms
8,912 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <cmath>

#define rep(i,n) for(i=0; i<n; ++i)
#define in(a) cin >> a
#define out(a,b) cout << a << b
using namespace std;
using lint = long long;

lint an(int n, int k, int m){
    lint x=k%m;
    if(x<m-n);
    else    x=0;

    return x;
}

int main(void){
    int i, j, n, m, k, cnt = 0, t;
    in(t);
    vector<vector<int>> x(t, vector<int>(3));
    rep(i,t){
        rep(j,3){
            in(n);
            x[i][j]=n;
        }
    }
    rep(i,t){
        out(an(x[i][0],x[i][2],x[i][1]),endl);
    }

    return 0;
}

0