173692025-07-15 10:22:52algoproMicimackĂł (40 pont)cpp17Wrong answer 4/401ms500 KiB
// UUID: 582df62c-c77b-41ca-918d-49a64a4e34ac
#include <iostream>
using namespace std;

int main() {
    int Y, X; // Y: Nyuszi távolsága, X: Malacka távolsága
    int K, N; // K: otthonrĂłl hozott csuprok, N: NyuszitĂłl kapott csuprok

    // Bemenet beolvasása
    cin >> Y >> X;
    cin >> K >> N;

    // Nyuszinál kap mézet
    K += N;

    // Csak Nyuszi után kezd enni: (X - Y) km-t tesz meg evéssel
    int d = X - Y;

    // Ha van nála, minden km-en megeszik egy csuprot
    if (K >= d) {
        K -= d;
    } else {
        K = 0;
    }

    // Kimenet: ennyi csupor marad Malackának
    cout << K << endl;

    return 0;
}
SubtaskSumTestVerdictTimeMemory
base4/40
1Wrong answer0/01ms316 KiB
2Wrong answer0/01ms500 KiB
3Wrong answer0/21ms316 KiB
4Wrong answer0/21ms316 KiB
5Wrong answer0/21ms316 KiB
6Wrong answer0/21ms316 KiB
7Wrong answer0/21ms316 KiB
8Wrong answer0/21ms316 KiB
9Wrong answer0/21ms316 KiB
10Wrong answer0/21ms316 KiB
11Wrong answer0/21ms316 KiB
12Wrong answer0/21ms316 KiB
13Wrong answer0/21ms316 KiB
14Accepted2/21ms316 KiB
15Wrong answer0/21ms316 KiB
16Wrong answer0/21ms316 KiB
17Wrong answer0/21ms316 KiB
18Wrong answer0/21ms316 KiB
19Wrong answer0/21ms316 KiB
20Accepted2/21ms316 KiB
21Wrong answer0/21ms316 KiB
22Wrong answer0/21ms316 KiB