77702024-01-11 09:25:50AblablablaSakktábla (75 pont)cpp17Accepted 75/753ms3060 KiB
#include <iostream>

using namespace std;

int main()
{
    int n, m;
    cin >> n >> m;

    int valasz = 0;
    int l = 1, r = 1415;
    while(l <= r){
        int k = (l + r) / 2;
        int ossz = k * k;
        int egyik = ossz / 2 + (ossz % 2);
        int masik = ossz / 2;

        if((n >= egyik && m >= masik) || (m >= egyik && n >= masik)){
            valasz = k;
            l = k + 1;
        } else{
            r = k - 1;
        }
    }

    cout << valasz << "\n";
}
SubtaskSumTestVerdictTimeMemory
base75/75
1Accepted0/03ms1876 KiB
2Accepted0/03ms2120 KiB
3Accepted5/53ms2392 KiB
4Accepted5/53ms2440 KiB
5Accepted5/53ms2528 KiB
6Accepted5/53ms2720 KiB
7Accepted5/53ms2808 KiB
8Accepted5/53ms2840 KiB
9Accepted5/53ms2816 KiB
10Accepted5/53ms2832 KiB
11Accepted7/73ms2832 KiB
12Accepted7/73ms2832 KiB
13Accepted7/73ms2960 KiB
14Accepted7/73ms3052 KiB
15Accepted7/73ms3060 KiB