# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
235116 | NONAME | Košnja (COCI17_kosnja) | C++17 | 140 ms | 760 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
#define el '\n'
using namespace std;
int main() {
int q;
cin >> q;
while (q--) {
int n, m, ans = 0;
cin >> n >> m;
if (n > m)
swap(n, m);
ans = 2 * (n - 1);
// if ((n & 1) && (m & 1)) ans = (n - 1) + (m - 1); else
// if (!(n & 1) && !(m & 1)) ans = n + (m - 1);
// else ans = 2 * (n - 1);
cout << ans << el;
}
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |