# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
235116 |
2020-05-27T06:23:22 Z |
NONAME |
Košnja (COCI17_kosnja) |
C++17 |
|
140 ms |
760 KB |
#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 |
1 |
Correct |
5 ms |
384 KB |
Output is correct |
2 |
Correct |
4 ms |
256 KB |
Output is correct |
3 |
Correct |
5 ms |
384 KB |
Output is correct |
4 |
Correct |
5 ms |
256 KB |
Output is correct |
5 |
Correct |
4 ms |
256 KB |
Output is correct |
6 |
Correct |
92 ms |
504 KB |
Output is correct |
7 |
Correct |
134 ms |
760 KB |
Output is correct |
8 |
Correct |
92 ms |
504 KB |
Output is correct |
9 |
Correct |
140 ms |
632 KB |
Output is correct |
10 |
Correct |
96 ms |
504 KB |
Output is correct |