#include <bits/stdc++.h>
#include <chrono>
//#include <ext/pb_ds/detail/standard_policies.hpp>
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
#define sinDegrees(x) sin((x) * PI / 180.0)
#define cosDegrees(x) cos((x) * PI / 180.0)
#define tanDegrees(x) tan((x) * PI / 180.0)
#define atanDegrees(x) atan(x)* 180.0 / PI
#define asinDegrees(x) asin(x)* 180.0 / PI
#define CEIL(a,b) (a+(b-1))/b)
#define flush fflush(stdout)
#define ULL unsigned long long
#define LL long long
#define LD long double
#define EPS 0.000000000000001
#define MOD 1000000007
#define endl '\n'
#define ALL(x) x.begin(),x.end()
#define RALL(x) x.rbegin(),x.rend()
#define LOWER(s) transform(s.begin(),s.end(),s.begin(),::tolower)
#define UPPER(s) transform(s.begin(),s.end(),s.begin(),::toupper)
#define MAXN (int)1e5+5
#define OO (LL)1e14
#define PI acos(-1)
#define LONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONG long long
//#pragma GCC optimize("trapv")
#pragma GCC optimize("-ffast-math")
#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math,O3")
#pragma GCC optimize("-Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,sse4.2,popcnt,abm,mmx,avx2,tune=native")
#pragma GCC optimize("-funroll-loops")
#pragma GCC optimize("-funroll-all-loops,-fpeel-loops,-funswitch-loops")
int dy[] = { 1,-1,0,0 };
int dx[] = { 0,0,1,-1 };
using namespace std;
using namespace chrono;
int32_t main() {
//freopen("badsubs.in", "r", stdin);
//freopen("badsubs.out", "w", stdout);
//auto start = high_resolution_clock::now();
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
int t;
cin >> t;
while (t--)
{
LL n, m;
cin >> n >> m;
cout << ((min(n, m) * 2) - 2) << endl;
}
//auto stop = high_resolution_clock::now(); auto duration = duration_cast<microseconds>(stop - start); cout << "\n Time taken by Main(): " << duration.count() << " microseconds" << endl;
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
204 KB |
Output is correct |
2 |
Correct |
1 ms |
308 KB |
Output is correct |
3 |
Correct |
1 ms |
204 KB |
Output is correct |
4 |
Correct |
1 ms |
204 KB |
Output is correct |
5 |
Correct |
1 ms |
204 KB |
Output is correct |
6 |
Correct |
10 ms |
844 KB |
Output is correct |
7 |
Correct |
15 ms |
1220 KB |
Output is correct |
8 |
Correct |
11 ms |
920 KB |
Output is correct |
9 |
Correct |
16 ms |
1228 KB |
Output is correct |
10 |
Correct |
11 ms |
844 KB |
Output is correct |