|
|
Common Boardprogram z1354; {$APPTYPE CONSOLE} var mas:array [0..50000] of integer; n,i,j,max:integer; s:string; ch:char; begin s:=''; while not eof do begin read(ch); if ch in ['a'..'z','A'..'Z'] then s:=s+ch; end; n:=length(s); max:=0; for i:=1 to n do begin for j:=n downto i+1 do if s[j]=s[n-i+1] then mas[j]:=mas[j-1]+1 else mas[j]:=0; if mas[n]>max then max:=mas[n]; end; for i:=1 to n do write(s[i]); for i:=n-max downto 1 do write(s[i]); end. Have no idea why this happened, but I've got WA 31 with Z-function and instant AC with prefix-function afterwards. O_o Can we somehow get the test 31? Edited by author 04.12.2013 04:59 Is test1 the sample? I have WA#1 !!! input 1 2 2 3 3 1 1 10 output 0 For whom who use floating K = n / m, try to this test: 3 99 - right answer is 98 99 3 - right answer is 98 my solution WA7, anyone post more test? thanks! my solution WA7, anyone post more test? thanks! Anybody have the code on the C? I thought about it for a long time and i have no ideas how to do this task. I would be very grateful if somebody help me with it. There is no single optimal move. There is exactly two moves, one of which is optimal. On every step of greedy, you must choose best of them. not correct first sample! 12 4 5 3 2 1 correct: 12 4 6 3 2 1 Yes. Because 5 3 2 1 is a bit confusing... Better, if it will 6 3 2 1 :) Edited by author 01.12.2013 03:16 Who can give me some tests(include#5) or hints? Try this test 16 1 3 4 5 7 9 10 11 12 13 14 16 18 19 21 22 The answer is 8 1 3 5 7 10 12 14 16 Hope it helps! Edited by author 30.11.2013 21:02 What's the test number 2 ? 1 20 19 18 17 2 21 22 15 16 3 24 23 14 13 4 25 8 9 12 5 6 7 10 11 I have WA5. Give me some explanation and tests please What may be in test #5? In any case, you have forgotten to sum up after powering matrices. I think following phrase should be changed: "Every member of each team must have friends in another team." Because firstly I thought that every member must have more than 1 friend, since it is "friends". so something like "Every member of each team must have at least one friend in another team" should work that's so strange I`m getting WA on test 1 my code prints for sample input #1 1 2 3 1 2 1 2 1 3 1 5 2 3 and for second : 1 2 1 2 1 2 1 4 2 3 3 4 please help me ! thank you Accepted after reread the problem statement problem says : "Each student is assigned one classroom he is responsible for" My output was wrong for test #1 In your output for sample #1 student no. 4 is never on duty! "Each of the students should be on duty at least once during these [m] days." |
|
|