Search found 79 matches

by ec3_limz
Mon Jun 09, 2003 3:23 pm
Forum: C++
Topic: A very very small problem
Replies: 12
Views: 3869

Is it correct?
The following will work though.

Code: Select all

if (cin>>i>>j>>k) {
...
}
by ec3_limz
Mon Jun 09, 2003 3:20 pm
Forum: C++
Topic: 2 dimensional dynamic array
Replies: 7
Views: 3158

Is it possible to create a vector of vectors?

For example.

Code: Select all

vector<vector<int>> array;
by ec3_limz
Sun Jun 01, 2003 5:23 pm
Forum: Algorithms
Topic: Points and polygons
Replies: 6
Views: 2697

Not quite a line, a "ray", (since a line would always intersect a polygon even number of times, discounting special cases.)
Sorry for my poor understanding, but exactly what is a ray? What is the difference between a ray and a line?
by ec3_limz
Wed May 28, 2003 12:51 pm
Forum: Volume 1 (100-199)
Topic: 100 - The 3n + 1 problem
Replies: 1394
Views: 189133

This problem is very easy to solve. But unless you think with care, you will got WA.
This problem is indeed one of the easiest in the Online Judge problem set. Just using brute force is fast enough. The only trap I know of is that i need not be less than j.
by ec3_limz
Mon May 26, 2003 1:47 pm
Forum: C
Topic: how to translate PASCAL into C/C++
Replies: 3
Views: 2309

i think you should first learn C syntax. then everything will be OK, because it's just the same. If you really want to use C to write programs, I see no logical alternative to learning C syntax and writing C code. However, I can't help but wonder if there are any programs out there that can actuall...
by ec3_limz
Mon May 26, 2003 1:44 pm
Forum: C
Topic: DJGPP sucks ?
Replies: 1
Views: 1616

I couldn't compile this successfully and didn't know why DJGPP doesn't know "cout" ? ("cout undeclared") You may want to try this. [cpp]#include <iostream> using namespace std; int main() { cout<<"DJGPP sucks ?"; return 0; } [/cpp] If the above does not work, you may want to try this as an alternat...
by ec3_limz
Mon May 26, 2003 1:32 pm
Forum: Off topic (General chit-chat)
Topic: How old are you? Statistics.
Replies: 121
Views: 177605

At the age of 15, I think I am the youngest person to post in this thread as of today. 8) I registered about 1 years and 2 months ago and have since got 157 problems Accepted or Accepted (Presentation Error). If you think that the number of problems I solve is by any means few, do note the fact that...
by ec3_limz
Mon May 26, 2003 1:23 pm
Forum: Algorithms
Topic: Find the number of a sequence, and backwards...
Replies: 10
Views: 3553

Where I can find the theory to problems 153, 619 and 10460 Because the theoretical backgound is the same. I have solved Problem 619 before. Be warned, however, that Problem 619 is an extremely difficult problem. Basically, treat a word as a base-26 number, where a=1 and z=26. For example, az = 1 * ...
by ec3_limz
Mon May 26, 2003 1:09 pm
Forum: Algorithms
Topic: Points and polygons
Replies: 6
Views: 2697

Shoot a ray to some point infinite and count the number of intersections.. got to be careful about special cases though.. I don't really follow. I think that what you are trying to say is that, pick a random line that passes through the given point, and count the number of times n that line interse...
by ec3_limz
Mon May 26, 2003 1:00 pm
Forum: Volume 100 (10000-10099)
Topic: 10023 - Square root
Replies: 121
Views: 28423

I got TLE

Sadly, I got a TLE for this problem. Any good algorithms out there? [cpp]#include <stdio.h> #include <string.h> typedef struct bignum_t { char d[2000]; }; int cmp(bignum_t a, bignum_t b) { int i; for (i = 0; i < 2000; i++) { if (a.d < b.d ) return -1; else if (a.d > b.d ) return 1; } return 0; } big...
by ec3_limz
Thu May 01, 2003 6:44 am
Forum: Algorithms
Topic: Points and polygons
Replies: 6
Views: 2697

Points and polygons

Given the vertices of a polygon in anti-clockwise order, as well as the coordinates of a point, is there an algorithm to determine whether the point lies inside the polygon?
by ec3_limz
Thu May 01, 2003 6:38 am
Forum: Volume 7 (700-799)
Topic: 751 - Triangle War
Replies: 17
Views: 7778

It seems you are using greedy for this problem. That is wrong, because it is not necessarily the best move to build a triangle in a move when it is possible. I can't give you an example here, but I can tell you I got only accepted using brute force. But wouldn't a brute-force algorithm take exponen...
by ec3_limz
Wed Apr 30, 2003 1:00 pm
Forum: Volume 7 (700-799)
Topic: 751 - Triangle War
Replies: 17
Views: 7778

751 - Triangles (WA)

As topic :roll: [cpp]#include <stdio.h> #include <string.h> const int lines[18][2] = { {1, 2}, {1, 3}, {2, 3}, {2, 4}, {2, 5}, {3, 5}, {3, 6}, {4, 5}, {4, 7}, {4, 8}, {5, 6}, {5, 8}, {5, 9}, {6, 9}, {6, 10}, {7, 8}, {8, 9}, {9, 10} }; const int tri[9][3] = { {0, 1, 2}, {2, 4, 5}, {3, 4, 7}, {5, 6, 1...
by ec3_limz
Thu Apr 24, 2003 1:35 pm
Forum: Volume 3 (300-399)
Topic: 317 - Hexagon
Replies: 3
Views: 2740

In the end, because I could not formulate an aglorithm, I tried brute force. [cpp]#include <stdio.h> #include <string.h> const int rowsz[15] = {3, 4, 5, 4, 3, 3, 4, 5, 4, 3, 3, 4, 5, 4, 3}; const int pos[19][3] = { {2, 5, 10}, {1, 5, 11}, {3, 6, 10}, {0, 5, 12}, {2, 6, 11}, {4, 7, 10}, {1, 6, 12}, {...
by ec3_limz
Tue Apr 08, 2003 12:07 pm
Forum: Volume 1 (100-199)
Topic: 130 - Roman Roulette
Replies: 25
Views: 2487

Thanks, I got Accepted with your help. Apparently I misunderstood the problem.

Go to advanced search