1202021-01-16 11:40:06Valaki2Sakktábla (75 pont)cpp11Accepted 75/752ms2028 KiB
#include <bits/stdc++.h>
using namespace std;

int main() {
    pair<int, int> db[1450];
    int x, a, b;
    for(int i = 0; i < 1450; ++i) {
        x = i * i;
        if(x%2){a=x/2;b=a+1;}
        else {a=x/2;b=x/2;}
        db[i].first=a;
        db[i].second=b;
    }
    int n, m;
    cin >> n >> m;
    //cout << sqrt(2000000);
    int i = 0;
    while(true) {
        if(min(n, m) >= db[i].first && max(n, m) >= db[i].second) {
            ++i;
        } else break;
    }
    cout << --i << "\n";
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base75/75
1Accepted0/02ms1876 KiB
2Accepted0/01ms1932 KiB
3Accepted5/51ms1988 KiB
4Accepted5/51ms1984 KiB
5Accepted5/51ms2000 KiB
6Accepted5/51ms2000 KiB
7Accepted5/51ms1996 KiB
8Accepted5/51ms2004 KiB
9Accepted5/51ms2000 KiB
10Accepted5/51ms2004 KiB
11Accepted7/71ms2012 KiB
12Accepted7/71ms2016 KiB
13Accepted7/71ms2020 KiB
14Accepted7/71ms2024 KiB
15Accepted7/71ms2028 KiB