Dmaxiya

[蓝桥杯 2026 省 B] 循环右移 参考代码

Apr 11th, 2026
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.33 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. #define endl '\n'
  5.  
  6. typedef long long LL;
  7. const int maxn = 1000000 + 100;
  8. int T;
  9. LL N, X, Y;
  10.  
  11. int main() {
  12.     ios::sync_with_stdio(false);
  13.  
  14.     cin >> T;
  15.     while (T--) {
  16.         cin >> N >> X >> Y;
  17.         cout << max(0LL, Y - X + 1) << endl;
  18.     }
  19.  
  20.     return 0;
  21. }
  22.  
Advertisement
Add Comment
Please, Sign In to add comment