Skip to content

Commit

Permalink
Update C - Boxes and Candies.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
AHMEDMOM1 authored Dec 29, 2024
1 parent 6d12082 commit b3175e3
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions Problem-Solving/level 2/Atcoder/C - Boxes and Candies.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,6 @@ Print the minimum number of operations required to achieve the objective.


/* // Solve in another way
int totalMaxtAmountApple(vector <int> applesInbox, int& x) {
int result{};
for (int sh : applesInbox) {
result += sh;
}
return result -= x * ceil((double)applesInbox.size() / 2);
}
*/

void prntSmEtngAple(int totalApple, vector <int>& applesInbox) {
cout << "Still apple in boxes is: { ";
Expand All @@ -66,6 +57,16 @@ int totalMaxtAmountApple(vector <int>& applesInbox, int& x) {
return totalApple;
}

/* // Solve in another way
int totalMaxtAmountApple(vector <int> applesInbox, int& x) {
int result{};
for (int sh : applesInbox) {
result += sh;
}
return result -= x * ceil((double)applesInbox.size() / 2);
}
*/

vector <int> inputAppleNumber(int& N, int& x) {
do {
cout << "N: ";
Expand Down

0 comments on commit b3175e3

Please sign in to comment.