結果

問題 No.1926 Sequence of Remainders
ユーザー soragsorag
提出日時 2022-08-21 16:32:34
言語 C++23
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 273 ms / 2,000 ms
コード長 989 bytes
コンパイル時間 1,239 ms
コンパイル使用メモリ 113,908 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-04-18 13:02:25
合計ジャッジ時間 12,983 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
6,816 KB
testcase_01 AC 183 ms
6,940 KB
testcase_02 AC 184 ms
6,944 KB
testcase_03 AC 186 ms
6,944 KB
testcase_04 AC 183 ms
6,944 KB
testcase_05 AC 185 ms
6,944 KB
testcase_06 AC 256 ms
6,944 KB
testcase_07 AC 254 ms
6,940 KB
testcase_08 AC 256 ms
6,944 KB
testcase_09 AC 261 ms
6,944 KB
testcase_10 AC 260 ms
6,944 KB
testcase_11 AC 250 ms
6,944 KB
testcase_12 AC 248 ms
6,940 KB
testcase_13 AC 264 ms
6,944 KB
testcase_14 AC 265 ms
6,940 KB
testcase_15 AC 261 ms
6,940 KB
testcase_16 AC 258 ms
6,940 KB
testcase_17 AC 248 ms
6,944 KB
testcase_18 AC 244 ms
6,940 KB
testcase_19 AC 262 ms
6,940 KB
testcase_20 AC 273 ms
6,940 KB
testcase_21 AC 253 ms
6,940 KB
testcase_22 AC 252 ms
6,944 KB
testcase_23 AC 247 ms
6,944 KB
testcase_24 AC 250 ms
6,940 KB
testcase_25 AC 247 ms
6,940 KB
testcase_26 AC 262 ms
6,940 KB
testcase_27 AC 252 ms
6,940 KB
testcase_28 AC 246 ms
6,940 KB
testcase_29 AC 249 ms
6,944 KB
testcase_30 AC 263 ms
6,940 KB
testcase_31 AC 257 ms
6,940 KB
testcase_32 AC 244 ms
6,940 KB
testcase_33 AC 259 ms
6,940 KB
testcase_34 AC 262 ms
6,940 KB
testcase_35 AC 258 ms
6,944 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include<utility>
#include <vector>
#include <map>
#include<string>
#include<queue>
#include<math.h>
#define pb push_back
#define all(x) begin(x),end(x)
#define gall(x) begin(x),end(x),greater<>()
#define ll long long
#define P pair<int,int>
#define lP pair<ll,ll>
#include <iostream>
#include <vector>
using namespace std;
vector<pair<long long, long long> > prime_factorize(long long N) {
vector<pair<long long, long long> > res;
for (long long p = 2; p * p <= N; ++p) {
        if (N % p != 0) {
            continue;
        }
        int e = 0;
        while (N % p == 0) {
            ++e;
            N /= p;
        }
        res.emplace_back(p, e);
    }
    if (N != 1) {
        res.emplace_back(N, 1);
    }
    return res;
}
using namespace std;
int main() {
    ll t;
    cin>>t;
    for(int i=0;i<t;i++){
        ll n,m,k,tmp;
        cin>>n>>m>>k;
        tmp=k%m;
        if(tmp<m-n) cout<<tmp<<endl;
        else cout<<0<<endl;
    }
    return 0;
}
0