Search found 36 matches

by dootzky
Mon Jun 06, 2005 3:49 pm
Forum: Volume 1 (100-199)
Topic: 159 - Word Crosses
Replies: 32
Views: 6733

159 WA why?

i do the following:

- take 4 words
- find out which one of 2 vertical words is longer
- form a array of chars (polje[20][20])
- fill it very carefully with spaces and letters of every word
- print out that array

here is my code, everything seems to be in order, did i miss somethin'?

cheers ...
by dootzky
Tue May 31, 2005 12:42 am
Forum: Volume 1 (100-199)
Topic: 154 - Recycling
Replies: 29
Views: 6206

damn ppl, this problem was really really badly described.
if it waren't for "almost human" dude, i would've never get ACC.

someone should do a better job when describing problems, like in volumes 600,700,etc.

first couple of volumes has terrible, terrible descriptions.

thx for the help, "almost ...
by dootzky
Mon May 30, 2005 12:05 am
Forum: Volume 1 (100-199)
Topic: 108 - Maximum Sum
Replies: 233
Views: 51731

aaaaah

aah, i see your point.

very nice conclusion. my bad 8)

thx mon, i really though there's something else wrong, but now i see that it was my typo.

cheers,
dootzky
by dootzky
Fri May 27, 2005 12:24 pm
Forum: Volume 1 (100-199)
Topic: 108 - Maximum Sum
Replies: 233
Views: 51731

yup

exactly! :o

therefore, how come that my code is ACCEPTED?!

anyway, the problem description says "maximum sum", and since i declare MAX as 0 (max=0), and all numbers in the array are negative, the MAXIMUM of all negative is still - 0. ??

i dunno if this makes any sense at all, or better yet, how ...
by dootzky
Wed May 18, 2005 10:48 pm
Forum: Volume 1 (100-199)
Topic: 114 - Simulation Wizardry
Replies: 80
Views: 16296

114

why SIGSEGV??

here is my code, it's little bit pointless to explain what i did, 'cause i simply SIMULATE the whole pinball thang :roll:

thx for any help,
dootzky


#include <iostream.h>

int i,j,m,n,x,y,a,b,c,d;
int wall_cost,way,life,points,total_points;
int value[200][200],cost[200][200 ...
by dootzky
Fri May 13, 2005 2:08 am
Forum: Volume 1 (100-199)
Topic: 108 - Maximum Sum
Replies: 233
Views: 51731

and really, "58050zz" asked a really good question, that even i don't uderstand, besides my ACC. :o

if input is:

-1 5 5
5 0 0
5 0 0

my code would go something like:
first elemet - B[0][0] = -1
ok, it's negative, skip it!
and all the other test would be less then 19.. no?!

BUT!! (there's always ...
by dootzky
Fri May 13, 2005 2:02 am
Forum: Volume 1 (100-199)
Topic: 108 - Maximum Sum
Replies: 233
Views: 51731

OMG!

i don't know how - i don't know why - BUT

this logic by "imlazy" is an imperative!! i mean - OMG!!
my program was returning TLE, and it was expected, because i was doing brute force O(n^6) - [what ever that may mean, i saw others use these terms, so i assume it's some time/complexity mark..?!]

so ...
by dootzky
Wed May 11, 2005 7:56 pm
Forum: Volume 103 (10300-10399)
Topic: 10363 - Tic Tac Toe
Replies: 54
Views: 33151

FINALY!

this is how i solved the problem, after 9 WA. :(

if ( X && O ) goto no;
if ( X && (a==b+1) ) goto yes;
if ( X && (a!=b+1) ) goto no;
if ( O && (a==b) ) goto yes;
if ( O && (a!=b) ) goto no;
if ( (a==b) || (a==b+1) ) goto yes; else goto no;

// check out
yes: cout << "yes"; goto end;

no ...
by dootzky
Wed May 11, 2005 7:54 pm
Forum: Volume 103 (10300-10399)
Topic: 10363 - Tic Tac Toe
Replies: 54
Views: 33151

finaly, a good solution!

this is how i solved the problem, after 9 WA. :(

if ( X && O ) goto no;
if ( X && (a==b+1) ) goto yes;
if ( X && (a!=b+1) ) goto no;
if ( O && (a==b) ) goto yes;
if ( O && (a!=b) ) goto no;
if ( (a==b) || (a==b+1) ) goto yes; else goto no;

// check out
yes: cout << "yes"; goto end;

no ...
by dootzky
Wed May 11, 2005 1:32 am
Forum: Volume 102 (10200-10299)
Topic: 10284 - Chessboard in FEN
Replies: 11
Views: 14674

hmmmm

i fried my brain with this problem, and i hope this hint helps:

http://online-judge.uva.es/board/viewtopic.php?p=34674#34674

that's my own post there, i was talking to myself! :P and got ACC, ofcourse! :lol:

but, about your program:

- it seems to me that you don't initialize ALL the 'squares ...
by dootzky
Wed May 11, 2005 1:31 am
Forum: Volume 102 (10200-10299)
Topic: 10284 - Chessboard in FEN
Replies: 11
Views: 14674

it was kind a fun talking with my self, actually! :P

i'm a gonna go talk to notepad for a while now.. :lol:

just messing with ya all,
respect,
dootzky
by dootzky
Wed May 11, 2005 1:15 am
Forum: Volume 102 (10200-10299)
Topic: 10284 - Chessboard in FEN
Replies: 11
Views: 14674

thank you, thank you, very much...

i must say - i'm very impressed how many of you replyed on my question. :-? :cry:

anyway, i found my own error. it was naive, ofcourse.
the similar problem i mentioned, p10196, was all about these conditions:

1) if the white king is in check
2) if the black king is in check
3) if none of them is ...
by dootzky
Mon May 09, 2005 11:51 am
Forum: Volume 103 (10300-10399)
Topic: 10363 - Tic Tac Toe
Replies: 54
Views: 33151

oh, i see what you mean... :o

my bad, my bad. it was late, and i was so sure i got it right. :-?

anyhow, i corrected my algorithm now, and this is how i check the table:

1) if they both win - NO - break;
2) if X wins && (numberO+1 == numberX) - YES - else NO; break;
3) if O wins && (numberO ...
by dootzky
Sun May 08, 2005 11:05 pm
Forum: Volume 103 (10300-10399)
Topic: 10363 - Tic Tac Toe
Replies: 54
Views: 33151

10363

OMG OMG OMG!!
why doesn't this work?! :evil:

it's very very simple:

1) check if number of "X" is equal or 1 bigger from number of "O"
2) check if somebody wins. if they both win - print "no". else print "yes".

so, if 1), go to 2), and 2) is really simple.

it's not really importan if X or O has ...
by dootzky
Sun May 08, 2005 3:03 am
Forum: Volume 103 (10300-10399)
Topic: 10346 - Peter's Smokes
Replies: 46
Views: 23852

really funny.

i would normaly solve this problem with a simulation, but hence the formula is now well known, i did it with ONE LINE?! omg.


void main () { long k,n; while (cin >> n >> k) cout << n+ ((n-1)/(k-1)) << endl; }


seriously, this is funny. :lol:

ofcoruse, line above this line is ...

Go to advanced search