1.

/* Problemnr: 674 Coin Change
* Author : Peter Schnitzler
* Sprache : C++
* Status : AC
* Runntime: 0.2s
*/

#include <iostream>

using namespace std;

unsigned long half[1498];
unsigned long quarter[1498];
unsigned long ten[1498];



unsigned long getten(int sum)
{
if (ten[sum] == 0)
{
unsigned long long local = 0;

if (sum >= 2)
{
local = getten(sum - 2);
}

local += sum + 1;
ten[sum] = local;
}

return ten[sum];

}

unsigned long getquarter(int sum)
{
if (quarter[sum] == 0)
{
unsigned long long local = 0;

if (sum >= 5)
{
local = getquarter(sum - 5);
}

local += getten(sum);
quarter[sum] = local;
}

return quarter[sum];

}

unsigned long gethalf(int sum)
{
if (half[sum] == 0)
{
unsigned long long local = 0;

if (sum >= 10)
{
local = gethalf(sum - 10);
}

local += getquarter(sum);
half[sum] = local;
}

return half[sum];
}


int main()
{
for (int count = 0; count < 1498; ++count)
{
half[count] = 0;
quarter[count] = 0;
ten[count] = 0;
}




int sum;
cin >> sum;

while (!cin.eof())
{
cout << gethalf(sum / 5) << endl;

cin >> sum;
}
}

2.


/* Angewandte Mathematik, SS09, IFB 2C
* ACM Problem #674 (Coin Change)
* Link: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=8&page=show_problem&problem=615
*
* @author Dennis Wilfert

* @version 1.0, 07/02/2009
*
* Status : Accepted
* Runtime: 0.240
*/
import java.io.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;


public class Main {

public static void main(String[] args) throws IOException {
StringBuilder output = new StringBuilder();
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
PrintWriter p = new PrintWriter(new BufferedOutputStream(System.out));
int[] coin = new int[]{50, 25, 10, 5, 1};

// Betrag als Integerwert in cent
int amount;

// Kombinationsmöglichkeiten für die verschiedenen Beträge
int[] nway = new int[7490];

// Zahl als String
String string;

// Hilfsvariablen
int c, i, j;
nway[0] = 1;

// Sämtliche Kombinationen für alle Beträge von 0 cent bis 7489 cent berechnen
for(i=0; i<coin.length; i++){
c = coin[i];
for(j = c; j<=7489; j++)
nway[j] += nway[j-c];
}
while(true){

string = reader.readLine();

if(string == null)break;

// Betrag als int-Wert
amount = Integer.parseInt(string);

output.append(nway[amount]);
output.append("\n");
}
p.print(output);
p.flush();
}

}



3.

import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;

/*
* ACM Programming Contest
* Problem: 674 Coin Change
* Status: Accepted
* Runtime: 0.888
* Date: 2009-05-28
* Author: Simon Baumgartner
*
*/

public class Main {

public static void main(String[] args) throws IOException {
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
// BufferedReader in = new BufferedReader(new FileReader("input.txt"));
int[] coins = new int[]{1, 5, 10, 25, 50};
int maxNr = 7499;
int[][] table = new int[coins.length][maxNr];

for(int y = 0; y < maxNr; y++)
{
for(int x = 0; x < coins.length; x++)
{
if(x == 0 || y == 0)
table[x][y] = 1;
else{
int index = y - coins[x];
int nr2 = (index >= 0 ? table[x][index] : 0);
table[x][y] = table[x-1][y] + nr2;
}
}
}

String line;
while((line = in.readLine()) != null){
int nr = Integer.parseInt(line);
System.out.println(table[4][nr]);
}
}

}