#1906: ans


1753980-3@g.puiching.edu.mo (P5A31蒲雋浠)

School : No School
ID : 2571
IP address : [192.168.120.33]
Last Login :
2025-05-06 20:40:09
a051. Apples Prologue -- P5709 【深基2.习6】 | From: [192.168.120.33] | Post Date : 2025-04-08 20:32

cpp
复制
#include <iostream>
using namespace std;

int main() {
    int m, t, s;
    cin >> m >> t >> s;
    
    if (t == 0) {
        // If eating takes 0 minutes, she eats all apples immediately
        cout << 0 << endl;
        return 0;
    }
    
    int eaten = s / t;
    if (s % t != 0) {
        eaten++; // she's in the process of eating the next apple
    }
    
    int remaining = m - eaten;
    if (remaining < 0) {
        remaining = 0; // she can't have negative apples left
    }
    
    cout << remaining << endl;
    return 0;
}

 

 

 
 
#1910: Re:ans


1755143-9@g.puiching.edu.mo (P5A35蔡雋言)

School : Pui Ching Middle School
ID : 3019
IP address : [192.168.120.33]
Last Login :
2025-05-05 14:32:19
a051. Apples Prologue -- P5709 【深基2.习6】 | From: [192.168.120.33] | Post Date : 2025-04-09 20:31

 

Emotional damage why you guys all post the answer?

The people that don't know can not learn anything! 

 



 
ZeroJudge Forum