96352024-02-23 16:47:30PallanekPéterFőzet készítéscpp17Wrong answer 25/5097ms6300 KiB
#include <bits/stdc++.h>
using namespace std;

int main(){
    int dp[501][501];
    for (int a=1; a<32; a++){
        for (int b=1; b<32; b++){
            if (a>10 and b>10 or __gcd(a, b)>1) continue;
            for (int i=500; i>=a; i--) {
                for (int j=500; j>=b; j--) {
                    dp[i][j]=max(dp[i][j], dp[i-a][j-b]+1);
                }
            }
        }
    }
    int t;
    cin >> t;
    for (int i=1; i<=t; i++) {
        int x, y;
        cin >> x >> y;
        cout << dp[x][y] << "\n";
    }
}
SubtaskSumTestVerdictTimeMemory
base25/50
1Accepted0/093ms3880 KiB
2Accepted0/097ms4064 KiB
3Accepted3/393ms4284 KiB
4Accepted2/293ms4564 KiB
5Accepted3/393ms4772 KiB
6Accepted2/293ms4736 KiB
7Accepted3/397ms4952 KiB
8Accepted2/297ms5080 KiB
9Accepted3/396ms5228 KiB
10Accepted2/297ms5440 KiB
11Accepted2/296ms5392 KiB
12Wrong answer0/296ms5392 KiB
13Wrong answer0/294ms5396 KiB
14Wrong answer0/294ms5400 KiB
15Wrong answer0/296ms5404 KiB
16Wrong answer0/294ms5664 KiB
17Wrong answer0/296ms5612 KiB
18Wrong answer0/294ms5616 KiB
19Wrong answer0/294ms5612 KiB
20Wrong answer0/396ms5884 KiB
21Accepted3/396ms5840 KiB
22Wrong answer0/397ms6096 KiB
23Wrong answer0/396ms6300 KiB