結果
問題 | No.1926 Sequence of Remainders |
ユーザー |
|
提出日時 | 2022-05-06 21:35:34 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 241 ms / 2,000 ms |
コード長 | 464 bytes |
コンパイル時間 | 1,372 ms |
コンパイル使用メモリ | 165,408 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-07-05 22:48:49 |
合計ジャッジ時間 | 11,865 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 35 |
ソースコード
#include <bits/stdc++.h> using namespace std; #define rep(i,n) for(int i=0; i<(n); i++) #define INF ((1LL<<62)-(1LL<<31)) #define all(a) (a).begin(),(a).end() #define rall(a) (a).rbegin(),(a).rend() typedef long long ll; typedef pair<ll,ll> pl; int main() { int t; cin >> t; while(t--) { ll n,m,k; cin >> n >> m >> k; ll pre=k%m; if(m-pre<=n) cout << 0 << endl; else cout << pre << endl; } return 0; }