Search found 160 matches

by _.B._
Mon Sep 06, 2004 2:32 am
Forum: Algorithms
Topic: Prime Number
Replies: 8
Views: 1663

Up to 10,000,000

Let's say the classical 1 to 1,000,000, or for 1 to 10,000,000.
No bigger than 10,000,000.
by _.B._
Sun Sep 05, 2004 10:45 pm
Forum: Algorithms
Topic: Prime Number
Replies: 8
Views: 1663

Prime Number

Greetings! Which is the fastest way to find if a number is Prime? My algorithm, brought from Pascal, is this: [cpp]bool Prime(unsigned long n) { unsigned long Con = 1,Max = sqrt(n); if (n < 2) return false; while ((Max > 1) && (Con < 2)) { if (n % Max == 0) Con++; Max--; } return Con == 1; } [/cpp]
by _.B._
Sun Sep 05, 2004 10:35 pm
Forum: Volume 106 (10600-10699)
Topic: 10697 - Firemen barracks
Replies: 45
Views: 15619

I\O.

Greetings! Well, this is all I can think of right now: Input: 5 -800.0 -799.9 0.0 0.0 800.0 799.9 -800.0 -799.9 0.0 0.0 800.0 800.0 -99.9 -100.0 -100.0 -99.9 0.0 0.0 0.0 0.0 0.1 0.0 0.0 0.1 0.0 0.0 0.0 0.0 0.0 0.0 Output: There is no possible location. The equidistant location is (-12798400.0, 12799...
by _.B._
Sun Sep 05, 2004 8:54 pm
Forum: Volume 106 (10600-10699)
Topic: 10697 - Firemen barracks
Replies: 45
Views: 15619

Real Type.

Greetings!
Real Type for everything.
Did you check the I/O in previos post?

Keep posting!
by _.B._
Sat Sep 04, 2004 11:54 pm
Forum: Volume 6 (600-699)
Topic: 630 - Anagrams (II)
Replies: 25
Views: 6313

Good!

Glad I could help ;)
Gratz on your 50 :)

Keep posting!
by _.B._
Sat Sep 04, 2004 7:14 pm
Forum: Volume 6 (600-699)
Topic: 630 - Anagrams (II)
Replies: 25
Views: 6313

Maybe this.

Heya Wolf! It's a pity I couldn't be of more help. Well, since we are gussing the input for this problem due to the lack of description, LAST thing I can think of is that the input looks like this (since others look like this too): 3 8 lato atol microphotographics rata rola tara tola pies tola kola ...
by _.B._
Sat Sep 04, 2004 1:51 am
Forum: Volume 6 (600-699)
Topic: 630 - Anagrams (II)
Replies: 25
Views: 6313

Well...

I found only 2 differences between the I/Os I've tried. They are: 1. You'll have to "trim" blank spaces at the beginning and/or the end of every word. I made this one in Pascal, and I only read valid chars to build the words. I believe the input MAY have words with blank spaces at the beginning or e...
by _.B._
Sat Sep 04, 2004 1:16 am
Forum: Volume 6 (600-699)
Topic: 630 - Anagrams (II)
Replies: 25
Views: 6313

Well, so far...

Greetings! Well, so far, you could change this: [cpp] if (strcmp(word .txt,word2.txt)==0) { czy++; cout.width(3); cout << czy; cout << ") " << word .original << endl; } [/cpp] To avoid the printing of " ". But still can't find a critical input for your program. Will post later.
by _.B._
Fri Sep 03, 2004 7:03 pm
Forum: Volume 6 (600-699)
Topic: 630 - Anagrams (II)
Replies: 25
Views: 6313

Indeed :)

Hello Wolf! Indeed it is, and I bet that's why there are SO many WAs for this problem. It just says in one of the Problemsets that it's a MI problem, but in the description it doesn't mention neither that it has a number of cases in the beginning of the problem, nor that you have to output a blank l...
by _.B._
Fri Sep 03, 2004 6:33 pm
Forum: Volume 106 (10600-10699)
Topic: 10697 - Firemen barracks
Replies: 45
Views: 15619

ACed in Pascal.

Greetings! Finally I got it ACed in Pascal :D If it can help others, here is what I did: To find if 2 slopes where approximated the same: [pascal]SameSlopes:=abs (Slope1 - Slope2) < 1E-14;[/pascal] To round it rigth: [pascal]if abs(frac(Y) - 0.55) < 1E-8 then Y:=Y+0.01; if abs(frac(X) - 0.55) < 1E-8...
by _.B._
Fri Sep 03, 2004 5:03 pm
Forum: Volume 106 (10600-10699)
Topic: 10697 - Firemen barracks
Replies: 45
Views: 15619

Will work on it...

That's one really critical Input:

0.3 0.5 0.0 0.9 0.2 0.8

Will see why I get The equidistant location is (-0.1, 0.5).

Muito obrigado Sergio!
by _.B._
Fri Sep 03, 2004 4:20 pm
Forum: Volume 6 (600-699)
Topic: 630 - Anagrams (II)
Replies: 25
Views: 6313

More like this...

Greetings!
More like this:

/* See I/O in post below */

Hope it helps ;)
Thanks to Daveon too!

Keep posting!
by _.B._
Thu Sep 02, 2004 9:19 pm
Forum: Volume 106 (10600-10699)
Topic: 10697 - Firemen barracks
Replies: 45
Views: 15619

Read the posts below this one :)

Took me more than 20 submissiones to get it ACed.
I'm using FreePascal.
Read posts below for I/O.
by _.B._
Wed Sep 01, 2004 8:28 pm
Forum: C++
Topic: Compile Error -> Integer to Char
Replies: 2
Views: 1665

Thanks.

Greetings!
Thanks for the suggestion CDiMa!
I'll work on that some other time.
Right now, a friend recommended me just to do this:
[cpp]return Mines+'0';[/cpp]
That worked just fine :)
ACed now :)

Keep posting!
by _.B._
Wed Sep 01, 2004 1:30 am
Forum: C++
Topic: Compile Error -> Integer to Char
Replies: 2
Views: 1665

Compile Error -> Integer to Char

Greetings! Need some help here :o How can I convert an Integer into a Char? I am getting a "Compile Error" in one program. The message includes: In function `char Minesweep()': implicit declaration of function `int itoa(...)' In my code I have: [cpp]#include <iostream.h> #include <stdlib.h> ... char...

Go to advanced search