题解 | #小美的外卖订单编号#
小美的外卖订单编号
https://www.nowcoder.com/practice/91506d447f3445c999a27d556e530a37
特判一下就可以了。
#include <iostream>
#include <queue>
#include <map>
#include <set>
#include <cmath>
#include <cstring>
#include <algorithm>
#include <iomanip>
#include <stack>
#include <numeric>
#include <ctime>
#include <string>
#include <bitset>
#include <unordered_map>
#include <unordered_set>
using namespace std;
using ll = long long;
const ll N = 1e5 + 5, mod = 1e9 + 7, inf = 2e18;
ll m, x;
void solve() {
cin >> m >> x;
cout << (x % m == 0 ? m : x % m) << '\n';
}
int main() {
ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
int t = 1;
cin >> t;
while (t--) {
solve();
}
return 0;
}
阿里云工作强度 705人发布
查看22道真题和解析