Problem:
Change-Making Problem
You want to make change for $n$ cents. Assuming that you have infinite supply of coins of 1, 5, 10 and/or 25 cents coins respectively, find the minimum number of coins you need.
Input
$n$
The integer $n$ is given in a line.
出力
Print the minimum number of coins you need in a line.
Constraints
$1 \le n \le 10^9$
Sample Input 1
100
Sample Output 1
4
Sample Input 2
54321
Sample Output 2
2175

Submitted solutions:

code_snippet: #include <stdio.h>

int main(){
	int count = 0;
	int num;
	scanf("%d",&num);
	while(num>0){
		while(num>=25){
			num-= 25;
			count++;
		}
		while(num >= 10){
			num-= 10;
			count++;
		}
		while(num >= 5){
			num -= 5;
			count++;
		}
		if(num == 0 ) break;
		num-=1;
		count++;
	}
	printf("%d\n",count);
}
accuracy: 1
time_ms: 10
memory_kb: 2976
final_rank: 1

code_snippet: #include <stdio.h>
int money[4] = {1, 5, 10, 25};
int main()
{
	int n, ans = 0;
	scanf("%d", &n);
	for(int i = 3; i >= 0; i--)
	{
		while(n >= money[i])
		{
			n -= money[i];
			ans++;
		}
	}
	printf("%d\n", ans);
	return 0;
}
accuracy: 1
time_ms: 10
memory_kb: 2976
final_rank: 1

code_snippet: #include <bits/stdc++.h>
using namespace std;
int main(){
    int n;
    int ans=0;
    cin >> n;
    while(n>=25){
        n-=25;
        ans++;
    }
    while(n>=10){
        n-=10;
        ans++;
    }
    while(n>=5){
        n-=5;
        ans++;
    }
    while(n>=1){
        n-=1;
        ans++;
    }
    cout << ans << endl;
    return 0;
}
accuracy: 1
time_ms: 10
memory_kb: 3120
final_rank: 6

code_snippet: #include<iostream>
#include<cctype>
#include<queue>
#include<cstring>
#include<cmath>
#include<cstdio>
#include<stack>
#include<string>
#include<vector>
#include<set>
#include<deque>

#define MAX 10001

using namespace std;

void solve()
{
	int n = 0;
	int cnt = 0;
	cin >> n;
	while (n!= 0)
	{
		if (n - 25 < 0)
		{
			if (n - 10 < 0)
			{
				if (n - 5 < 0)
				{
					while (n != 0)
					{
						n--;
						cnt++;
					}
				}
				else
				{
					n -= 5;
					cnt++;
				}
			}
			else
			{
				n -= 10;
				cnt++;
			}
		}
		else
		{
			n -= 25;
			cnt++;
		}
	}
	cout << cnt << endl;
}


int main()
{
	solve();
	return 0;
}
accuracy: 1
time_ms: 10
memory_kb: 3092
final_rank: 4

code_snippet: #include<iostream>
#include<cctype>
#include<queue>
#include<cstring>
#include<cmath>
#include<cstdio>
#include<stack>
#include<string>
#include<vector>
#include<set>
#include<deque>

#define MAX 10001

using namespace std;

void solve()
{
	int n = 0;
	int cnt = 0;
	cin >> n;
	while (n!= 0)
	{
		if (n - 25 < 0)
		{
			if (n - 10 < 0)
			{
				if (n - 5 < 0)
				{
					while (n != 0)
					{
						n--;
						cnt++;
					}
				}
				else
				{
					n -= 5;
					cnt++;
				}
			}
			else
			{
				n -= 10;
				cnt++;
			}
		}
		else
		{
			n -= 25;
			cnt++;
		}
	}
	cout << cnt << endl;
}


int main()
{
	solve();
	return 0;
}
accuracy: 1
time_ms: 10
memory_kb: 3092
final_rank: 4

code_snippet: #include <cstdio>
#include <vector>

using namespace std;

int main() {
    int n, ans = 0;
    vector<int> coins = {1, 5, 10, 25};

    scanf("%d", &n);
    for (int i = coins.size() - 1; i >= 0; i--) {
        int coin = coins[i];
        while (n >= coin) {
            n -= coin;
            ans++;
        }
    }
    printf("%d\n", ans);

    return 0;
}
accuracy: 1
time_ms: 10
memory_kb: 2976
final_rank: 1

code_snippet: #include <bits/stdc++.h>

#define log(x) cout << x << endl
#define logfixed(x) cout << fixed << setprecision(10) << x << endl;
#define all(x) (x).begin(), (x).end()
using namespace std;
using lint  = long long;
using Graph = vector<vector<int>>;

int main() {
  int res = 0;
  int n;
  cin >> n;
  while (n > 0) {
    if (n >= 25) {
      n -= 25;
    } else if (n >= 10) {
      n -= 10;
    } else if (n >= 5) {
      n -= 5;
    } else {
      n--;
    }
    res++;
  }
  log(res);
}
accuracy: 1
time_ms: 10
memory_kb: 3452
final_rank: 7