Search found 14 matches

by Pasa Yildirim
Thu Aug 10, 2006 10:36 pm
Forum: Algorithms
Topic: minimum edge for deletion
Replies: 21
Views: 6967

OK, works for me :D, thank you!
by Pasa Yildirim
Thu Aug 10, 2006 7:10 pm
Forum: Algorithms
Topic: minimum edge for deletion
Replies: 21
Views: 6967

Hello chrismoh! Well, for sample graph from IOI task, DFS will give following edges: Orginal: + | | | +------+ | | \ | | + | | / +------+ DFS: + (1) | | | + (2) + (5) | | \ | | + (6) | | + (3)--+ (4) By your algo, edge 5 have an even degree, now remove (4, 5). Now, 3 has an even number, so remove (2...
by Pasa Yildirim
Tue May 09, 2006 4:05 pm
Forum: Volume 103 (10300-10399)
Topic: 10311 - Goldbach and Euler
Replies: 98
Views: 24073

Mamun, thank You very much. I finnaly got AC (about 7.8 sec). :D

The problem was in 9999998. Anybody who stuck in TLE and has got fast sieve should try this input.

Thank you again!
by Pasa Yildirim
Mon May 08, 2006 6:26 pm
Forum: Volume 103 (10300-10399)
Topic: 10311 - Goldbach and Euler
Replies: 98
Views: 24073

Thank you for reply! If I understood You, Mamun, here if (n % 2 == 1 && isprime (n - 2)) { printf ("%d is the sum of %d and %d.\n", n, 2, n - 2); goto end; } I check wheter is number is odd, and if it is odd hen I do what You said. i can be odd here for some even n and continues to be odd. I assumed...
by Pasa Yildirim
Mon May 08, 2006 2:27 pm
Forum: Volume 103 (10300-10399)
Topic: 10311 - Goldbach and Euler
Replies: 98
Views: 24073

My modified code:

Code: Select all

/*** CUTTED ***/
by Pasa Yildirim
Mon May 08, 2006 9:23 am
Forum: Volume 103 (10300-10399)
Topic: 10311 - Goldbach and Euler
Replies: 98
Views: 24073

Thank you, mamun. I fix that, but it is still TLE.

I tested it on input 99999999, it gets immediatly the result.
Sieving takes about 3-4 secs at me (2.8GHz).

Can sieve be faster?

Regards,
PY
by Pasa Yildirim
Sun May 07, 2006 4:17 pm
Forum: Volume 103 (10300-10399)
Topic: 10311 - Goldbach and Euler
Replies: 98
Views: 24073

Fix

Hello, mf!
Thank you for the reply. I fixed my main function, but it's still TLE.
I tested big integers now, it's secondary fast.

Code: Select all

/*** CUTTED ***/
Any ideas?
by Pasa Yildirim
Sun May 07, 2006 1:23 pm
Forum: Volume 103 (10300-10399)
Topic: 10311 - Goldbach and Euler
Replies: 98
Views: 24073

10311 TLE with optimized sieve

Hi all! Well, I was searching around for sieve optimisation, and i was found it here: http://online-judge.uva.es/board/viewtopic.php?p=6457&highlight=#6457 I implemet this, but I got TLE (> 30sec). It works perfect at me. Here is the code: #include <cstdio> using namespace std; #define MAX 100000000...
by Pasa Yildirim
Sun Apr 09, 2006 2:28 pm
Forum: Volume 7 (700-799)
Topic: 727 - Equation
Replies: 156
Views: 36792

727 -- Equation Problems (WA)

Hello everybody! I'm stuck in 727. My program passes all sample inputs on the boards. And i dont know where is the problem. Can anybodu help me? #include <vector> #include <cassert> #include <cstdlib> #include <cstring> #include <iostream> #include <algorithm> using namespace std; /// FILE* fi = fre...
by Pasa Yildirim
Mon Jan 16, 2006 8:29 pm
Forum: Volume 3 (300-399)
Topic: 392 - Polynomial Showdown
Replies: 93
Views: 19039

Thank you!

I got AC! Thank you very much, Solaris!
by Pasa Yildirim
Sun Jan 15, 2006 8:21 pm
Forum: Volume 3 (300-399)
Topic: 392 - Polynomial Showdown
Replies: 93
Views: 19039

392 WA

Hello!

What is wrong with my code?

It passes all test data I found on this forum.

Code: Select all

REMOVED
by Pasa Yildirim
Wed Nov 23, 2005 8:46 pm
Forum: Volume 100 (10000-10099)
Topic: 10042 - Smith Numbers
Replies: 75
Views: 24180

chunyi81, thank you very much, i've got AC.
I don't even think that my mistake is so obivious :) :)
Thank you once more ;)
by Pasa Yildirim
Tue Nov 22, 2005 8:53 pm
Forum: Volume 100 (10000-10099)
Topic: 10042 - Smith Numbers
Replies: 75
Views: 24180

10042 WA

Hello! I have problems with my program :). Can anybody tell me what's wrong in the code. I use algorithm from Programming Challenges. // 10042: Smith numbers #include <cmath> #include <iostream> using namespace std; typedef unsigned long inte; inte sum (inte n) { inte r = 0; while (n) { r += n % 10;...
by Pasa Yildirim
Wed Mar 16, 2005 6:20 pm
Forum: Volume 105 (10500-10599)
Topic: 10530 - Guessing Game
Replies: 57
Views: 28666

Hello there. Well, i have problem with 10530 (alwats WA). I test the program with all sample inputs here, but it doesn't work. Can anybody help me? There is a code in cpp: #include <cstdio> #include <cstring> using namespace std; int main (void) { int number, h = 11, l = 0; char word[20]; while (sca...

Go to advanced search