| Show all threads Hide all threads Show all messages Hide all messages |
| How could be it solved | Xan Tei Jun | 1244. Gentlemen | 29 Oct 2009 19:14 | 2 |
let me know the algorithm please |
| i do not understand the statement >( | Aneto | 1714. Mnemonics and Palindromes 2 | 29 Oct 2009 14:55 | 5 |
Why for n=6 aababbaa is OK abbaabaa is WA ? Who understands the statement or have AC please explain me statement on some examples or say what does it mean "The complexity of a name is defined as the minimal number of palindromes into which it can be decomposed. Help Vasechkin to invent the most complex name for his problem." Thank you in advance aa bab b aa - 4 palindromes abba aba a - 3 palindromes 4 is max number of palindromes in all string with length 8. Edited by author 28.10.2009 17:03 what about a|a|b|a|b|b|a|a - 8 polyndromes :))) aa bab b aa - 4 palindromes abba aba a - 3 palindromes 4 is max number of palindromes in all string with length 8. Edited by author 28.10.2009 17:03 You wrote possible decomposition, but it not minimal. The complexity of a name is defined as the minimal number of palindromes into which it can be decomposed. Let's define F(S) as complexity of a string S. F(S) is equal to minimal number of palindromes into wicth it can be decomposed. for example consider string "abbaabaa" it can be decomposed in different ways a|bb|aabaa - 3 pflimdromes a|bb|a|aba|a - 5 pflindromes a|b|b|a|a|b|a|a - 8 palindromes the minimal number is 3, so F("abbaabaa") = 3 We must to find string S of given length N such that F(S) is maximal possible for all strings with legth N. |
| n=1500 seems to big.. | svr | 1717. Eligibility Rules | 29 Oct 2009 04:18 | 5 |
After sorting we have the problem of finding maximal-sum submatrix but it has O(n^3). After additional thinking- all OK! This is the way.For eaach row range [i1,i2] it should mantain set of nonzero columns and number of such colums in mean must be 1-10 Pardon...Tle. Instead 1-10 really we have 500 Edited by author 19.10.2009 20:45 Max-sum submatrix problem has O(N^2 log n) complexity As I heard, it is enough for this problem How? I only know how to solve Max-sum submatrix problem with O(n) non-zero elements with this asymptotic (deleted) Edited by author 29.10.2009 04:19 OK, I see my mistake now :o) N is number of non-zero elements, not the side of the matrix :o) |
| For those who get WA#9 | MAK | 1027. D++ Again | 29 Oct 2009 04:04 | 1 |
Keep in mind that: "An arithmetic expression in D++ may contain only symbols "=+-*/0123456789)(" and "end of line" symbols." So, answer for the test: (a) NO |
| Help me !!! | Asyamov Igor | 1646. Godzilla Strikes Back! | 28 Oct 2009 23:29 | 8 |
I use map<int,string> why it got MLE 5???? Edited by author 25.10.2008 18:30 Re: Help me !!! Vedernikoff Sergey (HSE: EconomicsForever!) 25 Oct 2008 19:59 In maxitest length of the string may be as large as 10*2^100 =) so and what kind of problems it is???? Re: Help me !!! Vedernikoff Sergey (HSE: EconomicsForever!) 25 Oct 2008 20:43 really?? I can't imagine how it could be solve with the help of dynamic.... could you tell me your idea???? for each DNA you must store number of occurences Godzilla's DNA in it, and prefix and suffix of this DNA, which length is less by one, than Godzilla's DNA s length. with this information you can easily compute next DNA Edited by author 27.10.2008 16:41 Thank you!!! Now AC :) !!! MOiAIS 1646 Java Memory limit exceeded 5 0.125 40 330 КБ My program used 40 MB, but restrictions - 64 MB. Why MLE? |
| Why WA31? | vgu | 1719. Kill the Shaitan-Boss | 28 Oct 2009 16:07 | 8 |
I use ternary search. My C++ solution has wa17 and Pascal solution with extended has wa31. Maybe this because i use sqrt function? Edited by author 26.10.2009 00:56 Edited by author 26.10.2009 00:56 I use ternary search too, sqrt-function, and type double in Java. I don't use epsilon in calculations. May be, calculations the distance from point to line is not too exact? I use vector product to calc 2*area of a triangle, and then divide it on base to get distance. I use vector product too :( why wa31 :( send me your code, and I'll try to tell you where is your bug: gm.alext@gmail.com :) I am sure that you have problem with precision. I tested one of solutions and found that point coordinates on line must be very exact. One way to get very exact coordinates: we have two points: a and b. double factor = value in range from -10000 to 10000 double dx = b.x - a.x; double dy = b.y - a.y; double x = a.x + dx * factor; double y = a.y + dy * factor; (x, y) - coordinates of point belongs to line, containing a and b. AC now :) Great thanks to Alex Tolstov |
| Crossing of diagonals? | Alexander Samal | 1719. Kill the Shaitan-Boss | 28 Oct 2009 13:23 | 4 |
No! WA 2 But it is strange... Not strange. Your idea is a drivel!! |
| what is the floyde-warshall | Xan Tei Jun | 1022. Genealogical Tree | 28 Oct 2009 11:59 | 3 |
It is an algorithm with complexity O(N^3) to find shortest distance between all vertices of a graph. Thaks a lot. I didn't notice this is an algorithm of Floid |
| What is topological sorting in graph | Xan Tei Jun | 1022. Genealogical Tree | 28 Oct 2009 11:53 | 3 |
Could anybody explain me what is the topological sorting. I don't understand well graphs. so what is this algorithm and how it can be realized? Send me e-mail please: shohruhhon1@mail.ru thanx in advance |
| the numbers k1, …, km, are sorted is not? | XMAN | 1087. The Time to Take Stones | 28 Oct 2009 06:38 | 2 |
the numbers k1, …, km, are not sorted this test is available 17 3 1 4 3 try to sort k1, …, km, i get AC when i do it |
| Please Help me: why i get WA test 1 | XMAN | 1087. The Time to Take Stones | 28 Oct 2009 02:14 | 1 |
#include<math.h> #include<stdio.h> int main() { int t[100],n,m,i,j,tr[10010]; scanf("%d",&n); scanf("%d",&m); for(i=1;i<=m;i++) {
scanf("%d",&t[i]); } for(i=1;i<=n;i++) { if(i<=t[1]) tr[i]=2; else { for(j=1;j<=m;j++) { if(i>t[j]) {printf("hhhhhhhhhhhh %d %d %d \n",i,t[j], tr[i-t[j]]); if(tr[i-t[j]]==2) {tr[i]=1; printf("hahaha\n"); break; } } } if(j==m+1) tr[i]=2;
} printf("%d %d\n",i,tr[i]); }
printf("%d",tr[n]);
return 0; } |
| If you get WA1... | →MOPDOBOPOT← | 1001. Reverse Root | 27 Oct 2009 20:14 | 1 |
I carried out input and output through files - received wrong answer 1. Has cleaned files - accepted ** Осуществлял ввод и вывод через файлы - WA1. Попробуйте эти файлы просто убрать :) |
| I've try many times , but stil WA#1 WHO CAN HELP ME!! | oliversun | 1027. D++ Again | 27 Oct 2009 17:06 | 5 |
And this is my code program ural1027; const ll='(*'; rr='*)'; type ts=ansistring; var s:ts; procedure rd; var ch:char; begin s:=''; while not eof do begin read(ch); if (ch<>#13) and (ch<>#10) then s:=s+ch; end; end; procedure print(i:integer); begin case i of 0: write('NO'); 1: write('YES'); end; halt; end; procedure dellr(var s:ts); var i,p,l:integer; begin p:=pos(ll,s); l:=length(s); while p<>0 do begin i:=p+3; while (i<=l) and not ((s[i]=')') and (s[i-1]='*')) do inc(i); if (i>l) or (i=p+2) then print(0); delete(s,p,i+1-p); if s='' then print(1); p:=pos(ll,s); l:=length(s); end; end; procedure solve(s:ts); var p:integer; t:ts; ss:string; function cannot(t:ts):boolean; var i,tot:integer; begin tot:=0; for i:=1 to length(t) do begin if s[i]='(' then inc(tot) else if s[i]=')' then dec(tot) else begin if not (s[i] in ['=','+','-','*','/','0'..'9',')','(']) then exit(true); end; if tot<0 then exit(true) else if (tot>0) and (s[i]=' ') then exit(true); end; if tot<>0 then exit(true) else exit(false); end; begin s:=s+' '; while s[1]=' ' do delete(s,1,1); p:=pos(' ',s); while (s<>'') and (p<>0) do begin t:=copy(s,1,p-1); if (pos('(',t)<>0) or (pos(')',t)<>0) then if cannot(t) then print(0); delete(s,1,p); while (s<>'') and (s[1]=' ') do delete(s,1,1); if s='' then break; p:=pos(' ',s); end; end; begin rd; dellr(s); solve(s); print(1); end. and if i remove the sentence " if not (s[i] in ['=','+','-','*','/','0'..'9',')','(']) then exit(true);" I'll get WA#9 Who Can Tell Me WHY~~~~ Edited by author 27.10.2009 16:17 I think You should read it with the help of EndofLine or Readln. s:=''; while not eof do begin read(ch); if ch>=' ' then s:=s+ch; if eoln then readln; end; I change it like this but still WA#1, can you tell me how to read it correctly You should read(ch) check if not eof and only then doing s:=s+ch; else break; |
| How do you get 0.001 at Pascal? | LGod | 1000. A+B Problem | 27 Oct 2009 16:18 | 2 |
No one get 0.001s for a long time |
| I've try many times , but stil WA | oliversun | 1027. D++ Again | 27 Oct 2009 15:42 | 1 |
|
| AC!!!! | Nguyen Canh Toan | 1024. Permutations | 27 Oct 2009 11:52 | 12 |
AC!!!! Nguyen Canh Toan 28 Nov 2005 23:22 I got AC with 0.015s 189kB Is it cool result???? I think there are many people that have better solutions. Edited by author 31.03.2006 00:03 Edited by author 31.03.2006 00:02 He He ! I got AC with 0.015s and 81 KB. I've got AC 0.093 and 286 KB. I know that there are better solusions - but i solve it MYSELF;-) I'm so proud;P I have 0.001s with 198 KB :) my algo got 0.015 with 200KB. I AC 0.000001s 0kb bilmadim slaram programmistmiz dab yurubsilar AC!!!! Proba 27 Oct 2009 11:52 vnashu shuncha ko`p sekunda bajaribdi hajmi ham ko`p Edited by author 27.10.2009 11:53 Edited by author 27.10.2009 11:54 |
| Help!please | 蛤蟆阳 | 1019. Line Painting | 27 Oct 2009 05:00 | 3 |
I failed in the test#3 many times.But i think my program is right.who can tell me the data of test#3? I've accepted.I'm so careless."The segment of numerical axis from 0 to 10**9 is painted into white color.".I saw the axis is from 1 to 10**9 at the first time.so i failed in the test#3 many times. |
| please answer | saba | 1068. Sum | 27 Oct 2009 01:39 | 6 |
yes Edited by author 27.10.2009 01:47 |
| if wa5 | Alexander (201 - P TNU) | 1123. Salary | 27 Oct 2009 00:16 | 4 |
if wa5 Alexander (201 - P TNU) 21 Feb 2008 02:08 maybe test 90999 -> 91019 help you 19992 -> 20002 is good too 19992 -> 20002 is good too Many, many, many thanks. |
| precision ? or wrong idea? | Dmitry "Logam" Kobelev [TSOGU] | 1722. Observation Deck | 26 Oct 2009 21:59 | 7 |
Hi all! I have problems with test 7 and I wonder whether wrong idea causes it or not... please, tell me, what the answer for 1000 1 498 0 -500 Is it 46.541438420 ? thx. thx ). btw, how much digits are right ? 46.5 - it is right, but than..... I print all digits of answer =) oh, gosh! In the long run I found that I had an idea problem, not precision. Thanks to all, AC now. |