# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
84662 | josiftepe | Košnja (COCI17_kosnja) | C++14 | 91 ms | 948 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>
using namespace std;
const int maxn = 500005;
int n;
int arr[maxn];
vector<pair<int, int> >v;
int main()
{
ios_base::sync_with_stdio(false);
int k;
cin>>k;
while(k--){
int n,m;
cin>>n>>m;
if(n==1 or m==1){
cout<<"0\n";
}
cout<<min(n*2-2,m*2-2)<<"\n";
}
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |