93502024-02-20 19:01:01AblablablaFőzet készítéscpp17Wrong answer 0/50165ms4076 KiB
#include <iostream>

using namespace std;

int main()
{
    int t;
    cin >> t;

    while(t--){
        int a, b;
        cin >> a >> b;
        a--; b--;

        int maxi = 0;

        for(int c = 0; c <= a; c++){
            for(int d = 0; d <= b; d++){
                if(c + (d + 1) * (d + 2) / 2 - 1 <= a && d + (c + 1) * (c + 2) / 2 - 1 <= b){
                    maxi = max(maxi, c + d);
                }
            }
        }

        cout << maxi + 1 << "\n";
    }
}
SubtaskSumTestVerdictTimeMemory
base0/50
1Accepted0/03ms1876 KiB
2Wrong answer0/014ms2120 KiB
3Wrong answer0/33ms2336 KiB
4Wrong answer0/23ms2544 KiB
5Wrong answer0/33ms2576 KiB
6Wrong answer0/23ms2820 KiB
7Wrong answer0/316ms3032 KiB
8Wrong answer0/214ms3116 KiB
9Wrong answer0/316ms3116 KiB
10Wrong answer0/214ms3244 KiB
11Wrong answer0/2160ms3328 KiB
12Wrong answer0/2162ms3328 KiB
13Wrong answer0/2164ms3452 KiB
14Wrong answer0/2164ms3544 KiB
15Wrong answer0/2163ms3428 KiB
16Wrong answer0/2158ms3428 KiB
17Wrong answer0/2164ms3680 KiB
18Wrong answer0/2156ms3792 KiB
19Wrong answer0/2162ms3888 KiB
20Wrong answer0/3158ms3904 KiB
21Wrong answer0/3157ms3992 KiB
22Wrong answer0/3165ms4076 KiB
23Wrong answer0/3165ms4072 KiB