Search found 32 matches

by sklitzz
Thu May 25, 2006 12:38 pm
Forum: Volume 102 (10200-10299)
Topic: 10229 - Modular Fibonacci
Replies: 53
Views: 16847

10229 Modular Fibonacci

Hi, I'm having trouble with this task. I roamed througout the forum and figured out that I have to use modular arithmetic and qmatricies. I know what modular arithmetic is but I never heared about q matricies, where can I find a good implementation and explanation about this. I already googled but c...
by sklitzz
Thu May 25, 2006 9:08 am
Forum: C++
Topic: It says compiler error
Replies: 6
Views: 2384

It says compiler error

Could anyone tell me why this code doesn't compile. #include <iostream> #include <algorithm> #include <map> #include <cstdio> using namespace std; int N, R; map < string, int > ind; int adj[200][200] = { false }; void floyd_warshall() { for( int k = 0; k < N; ++k ) for( int j = 0; j < N; ++j ) for( ...
by sklitzz
Thu May 25, 2006 8:30 am
Forum: Volume 5 (500-599)
Topic: 534 - Frogger
Replies: 41
Views: 17607

Thank you it worked.

Maybe the text should say it more explicitly.
by sklitzz
Wed May 24, 2006 11:36 pm
Forum: Volume 5 (500-599)
Topic: 534 - Frogger
Replies: 41
Views: 17607

534 Frogger

I'm going crazy with this task. I've implemented the Floyd Warshall minimax algorithm and it still won't work. Maybe I'm just sleepy but could anyone take a look at this code and see if there's a stupid bug somewhere in it. #include <cstdio> #include <cmath> #include <algorithm> using namespace std;...
by sklitzz
Fri Feb 18, 2005 10:33 am
Forum: Volume 101 (10100-10199)
Topic: 10192 - Vacation
Replies: 58
Views: 14175

10192 WA problem

I think the algorithm is ok, but I still get WA?! //Vacation( 10192 ACM ) #include <stdio.h> #include <string.h> #define MAX 101 char s1[MAX], s2[MAX]; int lcs() { int i, j; int dp[MAX][MAX] = { 0 }; int len1 = strlen( s1 ), len2 = strlen( s2 ); for( i = 1; i <= len1; ++i ) for( j = 1; j <= len2; ++...
by sklitzz
Fri Feb 18, 2005 9:44 am
Forum: Volume 104 (10400-10499)
Topic: 10405 - Longest Common Subsequence
Replies: 103
Views: 28745

Thanks Larry I got AC
by sklitzz
Thu Feb 17, 2005 10:40 pm
Forum: Volume 104 (10400-10499)
Topic: 10405 - Longest Common Subsequence
Replies: 103
Views: 28745

10405 Can anyone help me on this one

I don't get, why do I get WA? #include <stdio.h> #include <string.h> #define MAX 1001 int lcs( char *s1, char *s2 ) { int i, j; int dp[MAX][MAX] = { 0 }; int len1 = strlen( s1 ), len2 = strlen( s2 ); for( i = 1; i <= len1; ++i ) for( j = 1; j <= len2; ++j ) if( s1[i-1] == s2[j-1] ) dp[i][j] = dp[i-1...
by sklitzz
Tue Feb 15, 2005 7:29 pm
Forum: Volume 1 (100-199)
Topic: 147 - Dollars
Replies: 233
Views: 20437

Never mind this post I sollved the problem
by sklitzz
Tue Feb 15, 2005 7:14 pm
Forum: Volume 1 (100-199)
Topic: 147 - Dollars
Replies: 233
Views: 20437

147 Dollars WA(I can't figure it out!!!)

I just don't see it, is my algorihtm wrong or what? #include <cstdio> #include <cstring> using namespace std; const int M = 11, MAX_N = 300 * 100; long long coins[] = { 5, 10, 20, 50, 100, 200, 500, 1000, 2000, 5000, 10000 }; long long dp[MAX_N+1] = { 0 }; void solve() { dp[0] = 1; for( int j = 0; j...
by sklitzz
Tue Feb 15, 2005 10:21 am
Forum: Volume 1 (100-199)
Topic: 147 - Dollars
Replies: 233
Views: 20437

Thanky you for your advice but I'm getting now WA and I'm really confused( I beyed all the output rules ) #include <cstdio> #include <cstring> using namespace std; const int M = 11, MAX_N = 300 * 100; int coins[] = { 5, 10, 20, 50, 100, 200, 500, 1000, 2000, 5000, 10000 }; long long dp[MAX_N+1] = { ...
by sklitzz
Mon Feb 14, 2005 11:12 pm
Forum: Volume 1 (100-199)
Topic: 147 - Dollars
Replies: 233
Views: 20437

147 Dollars TLE

Why do I get TLE?! #include <cstdio> using namespace std; const int M = 11, MAX_N = 300 * 100; int coins[] = { 5, 10, 20, 50, 100, 200, 500, 1000, 2000, 5000, 10000 }; int solve( int N ) { int dp[MAX_N] = { 0 }; dp[0] = 1; for( int j = 0; j < M; ++j ) for( int i = 1; i <= N; ++i ) if( i >= coins[j] ...
by sklitzz
Tue Feb 08, 2005 10:12 pm
Forum: Volume 1 (100-199)
Topic: 195 - Anagram
Replies: 242
Views: 25639

Could anyone tell me why this comparision doesn't work? struct cmp { bool operator () ( const string &a, const string &b ) { string s1 = "", s2 = ""; for( int i = 0; i < a.length(); ++i ) s1 += toupper( a[i] ); for( int i = 0; i < b.length(); ++i ) s2 += toupper( b[i] ); if( s1 == s2 ) return ( a < ...
by sklitzz
Mon Feb 07, 2005 6:40 pm
Forum: Volume 1 (100-199)
Topic: 195 - Anagram
Replies: 242
Views: 25639

Does this mean that 'C'(big c) should be behind 'a'(small a ) although c is capital?
by sklitzz
Mon Feb 07, 2005 3:53 pm
Forum: Volume 1 (100-199)
Topic: 195 - Anagram
Replies: 242
Views: 25639

195 problem

I don't know why I get WA, maybe someone sees the error... #include <iostream> #include <string> #include <set> #include <algorithm> using namespace std; int N; set < string > perms; typedef set < string >::iterator SIT; int main() { cin >> N; for( int i = 0; i < N; ++i ) { string t; cin >> t; //gen...
by sklitzz
Sun Feb 06, 2005 6:17 pm
Forum: Volume 1 (100-199)
Topic: 195 - Anagram
Replies: 242
Views: 25639

Aaargh! I hate mistakes like this!

Anyway thanks!

Go to advanced search