28922023-02-02 09:45:17bzsofiaFőzet készítéscpp11Wrong answer 0/50536ms4548 KiB
// Fozet keszites.cpp : This file contains the 'main' function. Program execution begins and ends there.
//

#include <iostream>
#include <map>

using namespace std;

long long a, b, A, B, db, t, vana, vanb;
map <double, bool> x;

int main()
{
    cin >> t;

    while (t)
    {
        cin >> A >> B;
        db = 0;
        x.clear();
        vana = A;
        vanb = B;

        for (a = 1; a <= A; ++a)
        {
            for (b = 1; b <= B; ++b)
            {
                if (!x[a / b] && a<=vana && b<=vanb)
                {
                    ++db;
                    x[a / b] = 1;
                    vanb -= b;
                    vana -= a;
                    //cout << a << " " << b << "\n";
                }
            }
        }

        --t;
        cout << db << "\n";
    }

    return 0;
}

// Run program: Ctrl + F5 or Debug > Start Without Debugging menu
// Debug program: F5 or Debug > Start Debugging menu

// Tips for Getting Started: 
//   1. Use the Solution Explorer window to add/manage files
//   2. Use the Team Explorer window to connect to source control
//   3. Use the Output window to see build output and other messages
//   4. Use the Error List window to view errors
//   5. Go to Project > Add New Item to create new code files, or Project > Add Existing Item to add existing code files to the project
//   6. In the future, to open this project again, go to File > Open > Project and select the .sln file
SubtaskSumTestVerdictTimeMemory
base0/50
1Accepted0/03ms1748 KiB
2Wrong answer0/0140ms1912 KiB
3Wrong answer0/33ms2120 KiB
4Wrong answer0/23ms2244 KiB
5Wrong answer0/33ms2336 KiB
6Wrong answer0/23ms2548 KiB
7Wrong answer0/3138ms2640 KiB
8Wrong answer0/2145ms2768 KiB
9Wrong answer0/3141ms2976 KiB
10Wrong answer0/2141ms3060 KiB
11Time limit exceeded0/2462ms3296 KiB
12Time limit exceeded0/2467ms2728 KiB
13Time limit exceeded0/2474ms3488 KiB
14Time limit exceeded0/2453ms2832 KiB
15Time limit exceeded0/2536ms3828 KiB
16Time limit exceeded0/2472ms3188 KiB
17Time limit exceeded0/2451ms4128 KiB
18Time limit exceeded0/2467ms4252 KiB
19Time limit exceeded0/2463ms4340 KiB
20Time limit exceeded0/3463ms4336 KiB
21Time limit exceeded0/3476ms4332 KiB
22Time limit exceeded0/3453ms4412 KiB
23Time limit exceeded0/3469ms4548 KiB