Search found 27 matches
- Wed Apr 14, 2004 12:31 am
- Forum: Volume 104 (10400-10499)
- Topic: 10441 - Catenyms
- Replies: 15
- Views: 8048
Testing
Keep getting wrong answer, any test data? I have ran it on several things and works for each case.
- Tue Apr 06, 2004 8:22 pm
- Forum: C++
- Topic: ONLINE_JUDGE with C++
- Replies: 2
- Views: 1723
ONLINE_JUDGE with C++
I have figured out how to do this using stdio.h, but I am not sure how to do this with iostream/fstream. Here is the example code that is working:
[cpp]
#include <stdio.h>
#ifndef ONLINE_JUDGE
FILE *fin = fopen("myprog.in", "r");
FILE *fout = fopen("myprog.out", "w");
#else
FILE *fin = stdin ...
[cpp]
#include <stdio.h>
#ifndef ONLINE_JUDGE
FILE *fin = fopen("myprog.in", "r");
FILE *fout = fopen("myprog.out", "w");
#else
FILE *fin = stdin ...
- Sat Jan 31, 2004 7:38 pm
- Forum: Other words
- Topic: Please stop this rejudgement rate
- Replies: 25
- Views: 9506
Rejudging - necessary?
I am one of the people that is assisting with the rejudging of many of the problems on the board. However, so far, I am only responsible for solving one of the "unsubmittable" problems and then building a data set for it.
When it comes to rejudging problems, I don't think that a person who solved ...
When it comes to rejudging problems, I don't think that a person who solved ...
- Sat Jan 31, 2004 7:29 pm
- Forum: Volume 103 (10300-10399)
- Topic: 10315 - Poker Hands
- Replies: 63
- Views: 38569
Seg Fault
How is it that I can get a segmentation fault from the judge and not when running the test data? Does the judge have bad input? Here is what I have in terms of the input mode if someone has suggestions (I have done this portion in 4 or 5 different ways):
[cpp]
char cards[30];
while (gets(cards ...
[cpp]
char cards[30];
while (gets(cards ...
- Sat Nov 01, 2003 6:53 pm
- Forum: Volume 102 (10200-10299)
- Topic: 10270 - Bigger Square Please...
- Replies: 25
- Views: 15372
Algorithm
I understand the idea of backtracking for this problem, in general. However, I am having trouble deciding whether I should use the size of the squares as my "nodes", or the rows, or both...
- Wed Oct 29, 2003 8:34 am
- Forum: Volume 100 (10000-10099)
- Topic: 10049 - Self-describing Sequence
- Replies: 33
- Views: 18045
Accepted
I used a 700K array of ints and it ran in 0.217 s. So, I am happy. I like the other way with the double for loops. Not sure how you are only using 64K, though.
How to do it in time 0.000 s, don't know...seems impossible, unless there is a very quick formula. But using phi/tau, I couldn't get the ...
How to do it in time 0.000 s, don't know...seems impossible, unless there is a very quick formula. But using phi/tau, I couldn't get the ...
- Tue Oct 28, 2003 7:46 pm
- Forum: Off topic (General chit-chat)
- Topic: Avatar
- Replies: 12
- Views: 5692
Avatar
I am trying to use the avatar and set it under my profile. Whether I try to use the gallery or upload my own, it shows the "image not found box" where the image should be. Any ideas?
- Tue Oct 28, 2003 6:55 pm
- Forum: Volume 100 (10000-10099)
- Topic: 10049 - Self-describing Sequence
- Replies: 33
- Views: 18045
700000?
Yes, but if using the correct formula, wouldn't you need to generate 2 billion elements in the array? I don't see how only the first 700,000 will help.
- Fri Oct 24, 2003 7:07 pm
- Forum: Volume 105 (10500-10599)
- Topic: 10568 - n Group k
- Replies: 9
- Views: 3583
10568 - n Group k
Am I missing something with this problem? Or is it ridiculously easy?
- Fri Oct 24, 2003 4:44 pm
- Forum: Algorithms
- Topic: Any idea abt Edge list
- Replies: 1
- Views: 1975
Specifics
Can you be more specific with the question? If you are speaking of graph theory, where a graph G = (V,E), then there are several ways to handle this. One way is to use a <map>, from the STL. This is a nice type that maps pairs of type <T>. So, if you have a graph that has three nodes and 1 and 2 are ...
- Thu Oct 23, 2003 11:47 pm
- Forum: Volume 105 (10500-10599)
- Topic: 10571 - Products
- Replies: 27
- Views: 13967
Magic square?
Isn't this problem somewhat related to the magic multiplication square? I was looking for a pattern to the placements of the numbers, but haven't come up with anything so far. Another method I was thinking of is the divisors of each of the words flagged in an array and then try to do a comparison ...
- Thu Oct 23, 2003 4:44 pm
- Forum: Volume 8 (800-899)
- Topic: 847 - A Multiplication Game
- Replies: 41
- Views: 28183
Using multiplication
A converse to this would be to start p = 1, then alternately multiplying it by 9, 2, 9, etc. Once p >= n, the problem is solved.
Cheers
Cheers
- Thu Oct 23, 2003 2:06 am
- Forum: Volume 105 (10500-10599)
- Topic: 10574 - Counting Rectangles
- Replies: 23
- Views: 11262
Using Map
We never solved it during the online contest, but we used <map>. It was indexed on X, and the value at X was Y. So, we would go through each of the X's, and then try to follow a rectangle. If we couldn't do that, then there wasn't a rectangle. Didn't get it to work though.
- Fri Oct 17, 2003 8:16 pm
- Forum: Volume 101 (10100-10199)
- Topic: 10150 - Doublets
- Replies: 46
- Views: 45913
Clarification...
I am wondering about the doublets. Do they have to be the same length? Or, can something like
coastal
costal
postal
be a legitimate path? What is the purpose of keeping track of the node being visited or not? My method uses a <set> for the dictionary, and <queue> to keep track of the paths for ...
coastal
costal
postal
be a legitimate path? What is the purpose of keeping track of the node being visited or not? My method uses a <set> for the dictionary, and <queue> to keep track of the paths for ...
- Sat Apr 05, 2003 12:52 am
- Forum: Volume 5 (500-599)
- Topic: 576 - Haiku Review
- Replies: 50
- Views: 22438
Wrong Answer???
Well, the judge claims that I have a wrong answer, but I can't see it :roll:. If anyone else can, let me know.
[cpp]
#include <stdlib.h>
#include <string.h>
#include <iostream.h>
#define MAX_SIZE 256
char inLine[MAX_SIZE];
bool isVowel(char c) {
return ((c == 'a') || (c == 'e') || (c == 'i ...
[cpp]
#include <stdlib.h>
#include <string.h>
#include <iostream.h>
#define MAX_SIZE 256
char inLine[MAX_SIZE];
bool isVowel(char c) {
return ((c == 'a') || (c == 'e') || (c == 'i ...