15002022-11-21 14:21:14teodorbatkaiMicimackó (40 pont)cpp17Wrong answer 20/403ms4172 KiB
#include <bits/stdc++.h>

using namespace std;

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

    for(int i = 1; i < m; i++){
        cerr << k << " " << v << endl;
        if(i < n){
            k--;
        }
        else{
            if(k < 0){
                k = 0;
            } 
            v += k;
            k = 0;
            v--;
        }
    }
    if(v < 0){
        v = 0;
    }
    cout << v << endl;
}
SubtaskSumTestVerdictTimeMemory
base20/40
1Accepted0/03ms1876 KiB
2Accepted0/02ms2116 KiB
3Wrong answer0/22ms2272 KiB
4Wrong answer0/22ms2344 KiB
5Accepted2/23ms2476 KiB
6Accepted2/22ms2576 KiB
7Wrong answer0/22ms2780 KiB
8Accepted2/22ms2860 KiB
9Accepted2/22ms2992 KiB
10Wrong answer0/23ms3196 KiB
11Wrong answer0/22ms3444 KiB
12Accepted2/22ms3556 KiB
13Wrong answer0/22ms3520 KiB
14Accepted2/22ms3520 KiB
15Accepted2/23ms3476 KiB
16Wrong answer0/22ms3604 KiB
17Wrong answer0/22ms3684 KiB
18Wrong answer0/22ms3676 KiB
19Accepted2/23ms3828 KiB
20Accepted2/22ms3936 KiB
21Accepted2/23ms4060 KiB
22Wrong answer0/22ms4172 KiB