## Search found 6 matches

Thu May 24, 2012 8:01 am
Forum: Volume 6 (600-699)
Topic: 623 - 500!
Replies: 187
Views: 42980

### Re: 623 - 500!

In this problem we must precalculate all possible factorials, and print them out when requested. Calculate factorials of 1 to 1000 takes so mush time. What is the good way to find them? bignum f[1001]; int main(){ int n; f[0] = bignum("1"); f[1] = bignum("1"); for (int i = 2; i <= 1000; i++) f[i] = ...
Sun May 20, 2012 4:42 pm
Forum: Volume 4 (400-499)
Topic: 495 - Fibonacci Freeze
Replies: 222
Views: 29531

### Re: 495 - Fibonacci Freeze

I got TL for this problem. My algorithm that find n'th fibonacci number is not fast. Can someone help me? int main(){ int n; while (cin >> n) { bignum a, b; a = bignum(); // This means a = 0 b = bignum(); b.digits = 1; b.a[0] = '1'; // This means b = 1 if (n == 0) cout << "The Fibonacci number for "...
Sun May 20, 2012 1:08 pm
Forum: Volume 3 (300-399)
Topic: 371 - Ackermann Functions
Replies: 196
Views: 27945

### Re: 371 - Anckerman Functions

Thank you Brian...
Sat May 19, 2012 9:56 pm
Forum: Volume 3 (300-399)
Topic: 371 - Ackermann Functions
Replies: 196
Views: 27945

### Re: 371 - Anckerman Functions

Hello. I was wondering if you might be able to help me! Why I got RE for this problem? Here is my code:

Code: Select all

``Removed!``
Thank You
Sat Mar 17, 2012 5:28 pm
Forum: Volume 100 (10000-10099)
Topic: 10038 - Jolly Jumpers
Replies: 445
Views: 77439

### Re: 10038 - Jolly Jumpers

Can Someone help me? What's the problem of this code??? :-/ #include <iostream> using namespace std; int main(){ int n; while (cin >> n) { int m, j, d; cin >> m; bool jolly = true; bool inc1 = false; if (n > 1) { cin >> j; d = max(j, m) - min(j, m); if (d == n - 1) inc1 = false; else if (d == 1) inc...
Tue Jan 03, 2012 6:33 pm
Forum: Volume 2 (200-299)
Topic: 272 - TEX Quotes
Replies: 136
Views: 34634

### Re: 272 - TeX Quotes

Hi guys! What is the wrong of this code? #include <iostream> #include <cstring> #include <string> using namespace std; string s; void Shift(int i){ s += s[s.length() - 1]; for (int j = s.length() - 2; j > i; j--) s[j + 1] = s[j]; } int main(){ while (getline(cin, s)) { if (s.length() > 0) { int j = ...