QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#177846 | #4385. Random | jrjyy# | AC ✓ | 12ms | 3452kb | C++20 | 372b | 2023-09-13 14:39:46 | 2023-09-13 14:39:47 |
Judging History
answer
#include <bits/stdc++.h>
using i64 = long long;
constexpr int P = 1e9 + 7;
void solve() {
int n, m;
std::cin >> n >> m;
std::cout << 1ll * (n - m) * (P / 2 + 1) % P << "\n";
}
int main() {
std::cin.tie(nullptr)->sync_with_stdio(false);
int t;
std::cin >> t;
while (t--) {
solve();
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 12ms
memory: 3452kb
input:
100000 42 30 6335 1161 19170 15725 11479 6401 26963 24465 5706 5322 23282 16828 9962 492 2996 2955 4828 609 32392 14605 3903 154 293 77 17422 1295 19719 177 5448 5383 14772 11539 1870 1213 25668 632 17036 9895 28704 23812 31323 30334 17674 4665 15142 7712 28254 6869 25548 2097 32663 95 20038 12860 8...
output:
6 2587 500001726 2539 1249 192 3227 4735 500000024 500002113 500008897 500001878 108 500008067 9771 500000036 500001620 500000332 12518 500003574 2446 500000498 500006508 3715 500010696 500011729 16284 3589 3853 500013379 500004644 10174 119 49 500007944 500001824 500004584 4510 500006963 500010426 ...
result:
ok 100000 lines