QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#661881 | #4385. Random | syss# | WA | 11ms | 3696kb | C++20 | 438b | 2024-10-20 18:44:31 | 2024-10-20 18:44:32 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
constexpr int MOD = 1000000007;
void solve() {
int n, m;
cin >> n >> m;
n -= m;
if (n % 2 == 0) {
cout << n / 2 << '\n';
} else {
cout << n * (MOD + 1) / 2 << '\n';
}
}
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int t;
cin >> t;
while (t--) {
solve();
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 11ms
memory: 3696kb
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 218128084 2539 1249 192 3227 4735 -974836316 671074540 -1377198868 1894273940 108 1846449916 9771 -1859738108 1592309636 2082488132 12518 1382205588 2446 578764916 1919565892 3715 -1968481500 239375724 16284 3589 3853 971947260 1935357444 10174 119 49 -894466780 -566118940 2064899108 4510 165...
result:
wrong answer 3rd lines differ - expected: '500001726', found: '218128084'