#1906: ans


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

School : Pui Ching Middle School
ID : 2571
IP address : [192.168.120.33]
Last Login :
2025-06-09 13:37:17
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-06-13 08:58:27
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! 

 



 
#2673: Re:ans


1752786-4@g.puiching.edu.mo (林敬晉P5A08(JalenLam_progamer)(IQ...)

School : Pui Ching Middle School
ID : 3260
IP address : [192.168.120.33]
Last Login :
2025-06-05 11:37:15
a051. Apples Prologue -- P5709 【深基2.习6】 | From: [192.168.120.33] | Post Date : 2025-07-01 17:38

cpp
复制
#include 
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;
}

 

 

 


you are using ai and you use ai's program to get ac, so bad

 
ZeroJudge Forum