Search found 3 matches

by redrumpeace
Wed Oct 14, 2009 11:05 am
Forum: Volume 3 (300-399)
Topic: 357 - Let Me Count The Ways
Replies: 90
Views: 17678

Re: 357 WA

Hello, i got WA, i've checked the output and i think its good..
the code is :

# include <stdio.h>
# include <stdlib.h>
# include <iostream>
using namespace std;

int main ()
{
int uang;
long long dp[5][30001];
int nilai[5] = {1,5,10,25,50};

for (int i = 0; i <= uang; i++)
{
dp[0][i] = 1 ...
by redrumpeace
Fri May 29, 2009 9:34 am
Forum: Volume 3 (300-399)
Topic: 371 - Ackermann Functions
Replies: 196
Views: 51130

Re: 371 - Anckerman Functions - Why TLE ?

Hello, desperate here.. It got TLE.. :o :( :cry:

Here is my code
# include <stdio.h>
# include <stdlib.h>

int ackerman (long long number)
{
int count = 0;

do
{
if ((number % 2) == 0) number = number/2;
else number = (number*3) + 1;

count++;
}
while (number != 1);
return (count ...
by redrumpeace
Fri May 29, 2009 9:32 am
Forum: Volume 3 (300-399)
Topic: 371 - Ackermann Functions
Replies: 196
Views: 51130

Re: 371 : Ackermann Functions :: TL

Hello, desperate here.. It got TLE.. :o :( :cry:

Here is my code
# include <stdio.h>
# include <stdlib.h>

int ackerman (long long number)
{
int count = 0;

do
{
if ((number % 2) == 0) number = number/2;
else number = (number*3) + 1;

count++;
}
while (number != 1);
return (count ...

Go to advanced search