Yes, but I guess the test data wasn't that comprehensive--even though my solution was wrong, it somehow got AC.
Regardless, I still get this problem. In your earlier posts, you said that if
j > k > l
and n is large enough, then the actual values of j k and l don't matter. Why is that?
Search found 12 matches
- Sat Apr 01, 2006 6:59 pm
- Forum: Volume 109 (10900-10999)
- Topic: 10997 - Medals
- Replies: 10
- Views: 3652
- Sat Apr 01, 2006 8:50 am
- Forum: Volume 109 (10900-10999)
- Topic: 10997 - Medals
- Replies: 10
- Views: 3652
10997 - Medals
Hi,
I can't think of the real/intended way to solve this problem. I managed to make an AC solution by trying the vectors
(n,1,1) (n,2,1) .... (n,n,1).....(n,n,n)
so basically, I try to change each component from 1 to n. This means I try a total of n^3 different vectors.
Clearly, this wasn't the ...
I can't think of the real/intended way to solve this problem. I managed to make an AC solution by trying the vectors
(n,1,1) (n,2,1) .... (n,n,1).....(n,n,n)
so basically, I try to change each component from 1 to n. This means I try a total of n^3 different vectors.
Clearly, this wasn't the ...
- Thu Nov 03, 2005 3:30 am
- Forum: Volume 101 (10100-10199)
- Topic: 10149 - Yahtzee
- Replies: 20
- Views: 15918
- Tue Nov 01, 2005 2:04 am
- Forum: Volume 100 (10000-10099)
- Topic: 10044 - Erdos Numbers
- Replies: 102
- Views: 55231
Acc
Finally got AC!!!! Kinda surprised no one spotted my error.
- Mon Oct 31, 2005 11:51 pm
- Forum: Volume 101 (10100-10199)
- Topic: 10150 - Doublets
- Replies: 46
- Views: 45913
- Sun Oct 30, 2005 11:07 pm
- Forum: Volume 101 (10100-10199)
- Topic: 10150 - Doublets
- Replies: 46
- Views: 45913
10150 (Doublets) TLE
This is supposed to be a simple BFS graph problem but for some reason I keep getting TLE.
My program first stores the dictionary into a sorted, unique vector. Then for each pair of words in a test case I just use a simple BFS with the first word as the source vertex. For each word in the chain, I ...
My program first stores the dictionary into a sorted, unique vector. Then for each pair of words in a test case I just use a simple BFS with the first word as the source vertex. For each word in the chain, I ...
- Thu Oct 27, 2005 4:13 pm
- Forum: C++
- Topic: Combinations and Permutations
- Replies: 3
- Views: 2925
- Thu Oct 27, 2005 4:08 pm
- Forum: Volume 8 (800-899)
- Topic: 843 - Crypt Kicker
- Replies: 51
- Views: 35558
- Thu Oct 27, 2005 2:42 am
- Forum: C++
- Topic: Combinations and Permutations
- Replies: 3
- Views: 2925
Combinations and Permutations
I know in STL you can use the next_permutation algorithm to get permutations in linear time, but how do you get QUICK combinations in C++? e.g. how can I find all the different ways to choose 10 things out of 500 things in less than a few seconds, when the order doesn't matter?
I ask because I am ...
I ask because I am ...
- Thu Oct 27, 2005 2:33 am
- Forum: Volume 100 (10000-10099)
- Topic: 10044 - Erdos Numbers
- Replies: 102
- Views: 55231
10044 Erdos Number WA
For some reason my program keeps getting WA. I've tried the test cases from the previous post, and my I/O does what the previous posts suggested:
Upon closer inspection of my name-reading routine, I see that it was slightly more complicated than I described yesterday. Here's a detailed ...
Upon closer inspection of my name-reading routine, I see that it was slightly more complicated than I described yesterday. Here's a detailed ...
- Thu Oct 27, 2005 2:14 am
- Forum: Volume 8 (800-899)
- Topic: 843 - Crypt Kicker
- Replies: 51
- Views: 35558
843 Crypt Kicker OMG
How did anyone solve something like this in less than 3 hours??
After coding and re-coding for some time I finally managed to write a C++ program that accepts the test cases from
http://plg.uwaterloo.ca/~acm00/S98-1/
But it takes about 15 MINUTES. My design is backtracking, so my code should be ...
After coding and re-coding for some time I finally managed to write a C++ program that accepts the test cases from
http://plg.uwaterloo.ca/~acm00/S98-1/
But it takes about 15 MINUTES. My design is backtracking, so my code should be ...
- Thu Oct 20, 2005 5:33 am
- Forum: C++
- Topic: Sorting (Mutil-dimensional arrays)
- Replies: 2
- Views: 2229
Sorting (Mutil-dimensional arrays)
In the STL, is there a default function that sorts a rectangular 2D array based on a specified column? For instance, if I have:
Array-Index studentID grades
0 5 90
1 6 8
How do I get a list of the students based on grades ranking (i.e. Sort the grades column)? This should be a fairly common task ...
Array-Index studentID grades
0 5 90
1 6 8
How do I get a list of the students based on grades ranking (i.e. Sort the grades column)? This should be a fairly common task ...