Search found 85 matches

by Igor9669
Thu Apr 16, 2009 7:02 pm
Forum: Volume 116 (11600-11699)
Topic: 11601 - Avoiding Overlaps
Replies: 11
Views: 5173

Re: 11601 WA

Try such tests: 13 3 0 0 1 1 2 0 3 1 1 0 2 1 3 0 0 1 1 2 2 3 3 1 1 2 2 3 -1 -1 1 1 0 0 10 10 1 0 2 2 2 0 0 1 1 0 0 1 1 2 0 0 1 1 0 0 10 10 2 0 0 10 10 0 0 1 1 0 3 0 0 2 2 0 4 2 7 0 2 2 4 5 0 0 1 1 0 2 1 3 2 0 3 1 2 2 3 3 1 1 2 2 9 0 0 1 1 0 2 1 3 2 0 3 1 2 2 3 3 1 1 2 2 0 1 1 2 1 2 2 3 2 1 3 2 1 0 2...
by Igor9669
Sun Mar 29, 2009 8:58 am
Forum: Volume 115 (11500-11599)
Topic: 11577 - Letter Frequency
Replies: 19
Views: 7361

Re: 11577-Letter Frequency

change scanf("%d",&count); to scanf("%d\n",&count); get Acc and delete your code :)
by Igor9669
Sun Mar 29, 2009 8:44 am
Forum: Volume 115 (11500-11599)
Topic: 11584 - Partitioning by Palindromes
Replies: 14
Views: 3857

Re: 11584 - Partitioning by Palindromes

For example we have a string s; O(n^2) how to find palindromes: int l,r; s[0]='*'; s[s.length()]='*'; for(int i=1;i<s.length();++i) { l=i-1; r=i+1; while(s[l]==s[r]) { //some code ....... l--;r++; } l=i; r=i+1; while(s[l]==s[r]) { //some code ....... l--;r++; } //also the string form i to i is a pal...
by Igor9669
Sun Mar 29, 2009 8:12 am
Forum: Volume 115 (11500-11599)
Topic: 11583 - Alien DNA
Replies: 5
Views: 1223

Re: 11583 - Alien DNA

Don't use cin here, it is too slow....
by Igor9669
Sat Mar 28, 2009 4:10 pm
Forum: Volume 115 (11500-11599)
Topic: 11583 - Alien DNA
Replies: 5
Views: 1223

11583 - Alien DNA

What need to do in this problem???
Please... :D
by Igor9669
Fri Mar 06, 2009 3:38 pm
Forum: Volume 115 (11500-11599)
Topic: 11585 - Nurikabe
Replies: 20
Views: 7327

Re: 11585 - Nurikabe

Finally accepted!!!!!
But my ac prog gives such answer on my test:

Code: Select all

3

1 2 0
##

1 1 0
.

1 1 0
#

Code: Select all

solved
not solved
solved
by Igor9669
Fri Mar 06, 2009 3:09 pm
Forum: Volume 115 (11500-11599)
Topic: 11585 - Nurikabe
Replies: 20
Views: 7327

Re: 11585 - Nurikabe

I used dfs, but still WA....

Please anybody give some tests!
I don't know where I have a mistake...

What will be the answer for that test:

3

1 2 0
##

1 1 0
.

1 1 0
#
by Igor9669
Sat Feb 28, 2009 9:17 am
Forum: Volume 115 (11500-11599)
Topic: 11584 - Partitioning by Palindromes
Replies: 14
Views: 3857

Re: 11584 - Partitioning by Palindromes

I had discripted my algo above!
I don't need to find the largest palindrom at first!!!
by Igor9669
Thu Feb 26, 2009 12:42 pm
Forum: Volume 115 (11500-11599)
Topic: 11584 - Partitioning by Palindromes
Replies: 14
Views: 3857

Re: 11584 - Partitioning by Palindromes

Try this:

Code: Select all

7
amadam
madama
zzxzcc
qwerty
zzxxxz
zxxxzz
zxzczxxzc
Answer:

Code: Select all

2
2
3
6
2
2
2
by Igor9669
Tue Feb 24, 2009 7:19 pm
Forum: Volume 115 (11500-11599)
Topic: 11584 - Partitioning by Palindromes
Replies: 14
Views: 3857

Re: 11584 - Partitioning by Palindromes

Try this tests:
2
asaaaa
azzaa

correct answer are:
2 (asa aaa)
2 (azza a)

Your programm output:
1
1

And you should modify your algo to find palindroms, because you will get TLE with it.Try to make O(n^2)algo
by Igor9669
Tue Feb 24, 2009 6:43 pm
Forum: Volume 115 (11500-11599)
Topic: 11585 - Nurikabe
Replies: 20
Views: 7327

Re: 11585 - Nurikabe

I understood, that I don't understand this statement :D !
Could you please show me in the figure above, where is a mistake...
by Igor9669
Sun Feb 22, 2009 9:15 pm
Forum: Volume 115 (11500-11599)
Topic: 11584 - Partitioning by Palindromes
Replies: 14
Views: 3857

Re: 11584 - Partitioning by Palindromes

I construct a graph, where vertices were symbols of the string, and edges connected a pair of such symbols(X,Y),where in X the palindrom begined and before Y it ended. So, now the problem is to find the shortest path from the first symbol to the (last+1). To find all palindroms in the string I use O...
by Igor9669
Sun Feb 22, 2009 1:33 pm
Forum: Volume 115 (11500-11599)
Topic: 11584 - Partitioning by Palindromes
Replies: 14
Views: 3857

Re: 11584 - Partitioning by Palindromes

I solved this problem with the help of BFS!
by Igor9669
Sun Feb 22, 2009 6:45 am
Forum: Volume 115 (11500-11599)
Topic: 11585 - Nurikabe
Replies: 20
Views: 7327

11585 - Nurikabe

Please explain me why in second example the answer is "not solved"???

3#1#2
.###.
.#1##
####3
2.#..
by Igor9669
Tue Dec 30, 2008 9:28 pm
Forum: Volume 115 (11500-11599)
Topic: 11565 - Simple Equations
Replies: 21
Views: 6100

Re: 11565 - Simple Equations

input is not right!

Go to advanced search