Search found 79 matches

by jaracz
Tue Aug 09, 2005 12:34 am
Forum: Volume 105 (10500-10599)
Topic: 10530 - Guessing Game
Replies: 57
Views: 27794

Here's more test cases INPUT 10 too high 3 too low 4 too high 2 right on 5 too low 7 too high 6 right on 9 too low 8 too low 7 too low 10 right on 7 too high 7 right on 1 too low 2 too high 3 right on 3 too high 8 too high 1 too low 2 right on 5 right on 10 too low 9 too high 6 right on 0 OUTPUT Sta...
by jaracz
Fri Jul 29, 2005 12:56 am
Forum: Volume 3 (300-399)
Topic: 305 - Joseph
Replies: 41
Views: 3820

305 speed up

Hi I'm really confused abt how to speed up my algo, I did it several times, but still gettin' TLE my algo actually stacks with number->12 (about 8sec) and 13 more... It makes me angry!! Will I be forced to write down on paper result from my TLE solution and make big "switch"?? here's my code if some...
by jaracz
Thu Jul 28, 2005 12:48 am
Forum: Volume 1 (100-199)
Topic: 146 - ID Codes
Replies: 35
Views: 5761

next_permutation returns false when the current stan of container(string) is descending sorted
try to do this:

Code: Select all

while(gets(line) && strcmp(line,"#"))
{
    if(std::next_permutation(line,line+strlen(line)))
    printf("%s\n",line);
    else printf("No Successor\n");
}
and it's all
by jaracz
Wed Jul 27, 2005 10:04 am
Forum: Volume 106 (10600-10699)
Topic: 10626 - Buying Coke
Replies: 23
Views: 15824

input 20 200 3 0 20 200 2 0 coins:1 money in machine:5 19 200 1 0 coins:2 money in machine:2 19 200 0 0 coins:3 money in machine:7 18 199 0 0 coins:4 money in machine:0 ... this mean: put 5coin -- nothing happened put 5coin -- 1st coke bought 2$ left put 5coin -- nothing happened (money = 7) --no mo...
by jaracz
Mon Jul 25, 2005 12:09 am
Forum: Volume 102 (10200-10299)
Topic: 10245 - The Closest Pair Problem
Replies: 92
Views: 10616

At last I've passed all in/out in efficient time indeed:)
OJ gave me CE but on my Dev-Cpp it runs,I'm supposed to fix it for a while i think i'm close to be ACed
Gr8 thx to you!! tan_Yui
by jaracz
Sun Jul 24, 2005 12:39 pm
Forum: Volume 102 (10200-10299)
Topic: 10245 - The Closest Pair Problem
Replies: 92
Views: 10616

I said that I used qsort() (implemented in <stdlib.h> library),but finally got TLE, so let's turn to your algo now :). I did similar (x_range) loop but gave me WA (was a bit different when i see now yours), I think I'll try to cope it by myself, basing on your advise, but if a fail(which is much pos...
by jaracz
Sat Jul 23, 2005 11:39 pm
Forum: Volume 102 (10200-10299)
Topic: 10245 - The Closest Pair Problem
Replies: 92
Views: 10616

I did it like it was written in this site; Only sort(qsort) and finding 2 minimal distances between points in 2 equal-size sets gives TLE so I think it isn't such an efficient algo, must exist better About your advise. I don't understand what did you mean in point 3. Could you explain much clear, or...
by jaracz
Thu Jul 21, 2005 11:41 pm
Forum: Volume 102 (10200-10299)
Topic: 10245 - The Closest Pair Problem
Replies: 92
Views: 10616

Thanks! I think I'm now in a good way to solve this in efficient time
standby :)
by jaracz
Thu Jul 21, 2005 2:02 pm
Forum: Volume 102 (10200-10299)
Topic: 10245 - The Closest Pair Problem
Replies: 92
Views: 10616

how to compare all pairs faster than O(n^2) it gives TLE of course
by jaracz
Wed Jul 20, 2005 10:32 pm
Forum: Volume 100 (10000-10099)
Topic: 10017 - The Never Ending Towers of Hanoi
Replies: 19
Views: 5443

I agree!!
You must predict what'll happen in first test case
so don't worry abt this, if you passed 2nd input, then you'll get for sure AC
by jaracz
Wed Jul 20, 2005 5:48 pm
Forum: Volume 4 (400-499)
Topic: 444 - Encoder and Decoder
Replies: 155
Views: 21697

I have a little bit another time : Wed Jul 20, 2005 4:48 pm
is it cheating?? ;)
let's go back to the future:> c'ya
by jaracz
Wed Jul 20, 2005 5:37 pm
Forum: Volume 4 (400-499)
Topic: 444 - Encoder and Decoder
Replies: 155
Views: 21697

nope, I failed one test
sory for my "bad manner" I was so bored of keepin' wa...
anyway your in/out helped me a lot
ACed now, thanks
by jaracz
Wed Jul 20, 2005 3:47 pm
Forum: Volume 4 (400-499)
Topic: 444 - Encoder and Decoder
Replies: 155
Views: 21697

I've got WA too

here's my code
any suggestions??

Code: Select all

as you wish  
by jaracz
Sun Jul 17, 2005 5:35 pm
Forum: Volume 4 (400-499)
Topic: 413 - Up and Down Sequences
Replies: 22
Views: 5334

your program didn't pass even sample input, have you noticed it? this is your incorrect test case: 4 4 4 3 3 3 4 0 it should be Nr values = 7: 1.000000 5.000000 but you have Nr values = 7: 3.000000 5.000000 and here's more test cases for those who have difficulty solving it: INPUT 1 2 3 0 3 2 1 0 1 ...
by jaracz
Tue Jul 12, 2005 10:36 am
Forum: Volume 101 (10100-10199)
Topic: 10100 - Longest Match
Replies: 95
Views: 20888

Now my prog passed your tests, but still WA here's my code #include <stdio.h> #include <string.h> #include <ctype.h> #define max 1001 int isblank(char *a) { for(char *i = a; *i; i++) if(!isspace(*i))return 0; return 1; } void clear(char *a,char *b) { for(char *i = a; *i; i++) if(!isalnum(*i))*i = ' ...

Go to advanced search