| Show all threads Hide all threads Show all messages Hide all messages |
| AVL is also solves it | Alexey Chernenkov (Deprecated) | 1028. Stars | 1 Jul 2007 03:29 | 2 |
I'am using AVL-tree to solve this problem... it seems to be not effective... but works too Edited by author 01.07.2007 03:01 Index trees are more usefull here... |
| Good Problem) | Alex Fetisov | 1129. Door Painting | 30 Jun 2007 21:03 | 1 |
Edited by author 30.06.2007 21:05 |
| bad tests for problem 1080 | AB&B | | 30 Jun 2007 18:46 | 4 |
My solution for this input: 5 4 0 3 0 5 0 5 0 0 print 0-2-210 It's wrong answer, but my solution is AC :) 1. And you are sure, what there there is such test? 2. Simply having added this test you receive WA, and someone is possible still. It speaks that it is necessary simply to find a small mistake in your decision. It's obviously that my solution needs correct, but in first i want to correct tests for this problem! And i wrote to the administration of site and get: The original message was received at Sat, 30 Jun 2007 11:30:48 +0600 from f64.mail.ru [194.67.57.98] ----- The following addresses had permanent fatal errors ----- judge@busin.usu.ru (reason: 550 5.1.1 <judge@busin.usu.ru>... User unknown) (expanded from: <acm_support@acm.timus.ru>) ----- Transcript of session follows ----- .... while talking to busin.usu.ru.: >>> DATA <<< 550 5.1.1 <judge@busin.usu.ru>... User unknown 550 5.1.1 judge@busin.usu.ru... User unknown <<< 503 5.0.0 Need RCPT (recipient) I'm in confusion now :( 1. There are several administrators for this site. So the message above just tells that one of them (me) do not receive the message. 2. You may write one more time to contact e-mail as the problem with mail delivery is fixed already. So do not feel confused. :) |
| At last AC...Who got WA#12 can test this data: | Yitao | 1416. Confidential | 30 Jun 2007 18:39 | 2 |
6 6 1 2 8 2 3 3 3 5 2 2 4 7 4 6 2 2 5 6 The correct answer is: Cost: 22 Cost: 25 But the program made by me which WA 12 prints: Cost: 22 Cost: 20 I also got WA 12, but pass this test correctly... Ops, I forget that weight of an edge can be equal to 0. Edited by author 30.06.2007 20:00 |
| Please, give me some tests. | Alex Stoff | 1348. Goat in the Garden 2 | 30 Jun 2007 17:39 | 4 |
I want to check my program (WA#2) Try the following cases: 1) Length of the rope is more than the distance. 2) Dot is inside the segment. 3) Segment is dot. thanks you very much ! I find my mistake now ! But not enough. I still have WA#2 Edited by author 30.06.2007 17:54 |
| Where is the end of file in C# ? Help me, please ! | Fire Heart ( Training C# ) | 1001. Reverse Root | 30 Jun 2007 17:20 | 1 |
Where is the end of file in C# ? Help me, please ! |
| Give me some test pls. I got WA26 | qwe | 1430. Crime and Punishment | 30 Jun 2007 16:39 | 1 |
Give me some test:), or may be some think wrong with test???? |
| WhY WA#16???????????????!!!!!!!! I think it true solution | CHIDEMYAN SERGEY | 1537. Ents | 30 Jun 2007 15:00 | 13 |
Edited by author 16.03.2007 22:42 Pay attention on this line a[i]=a[i-1]+a[i/2]; What mistake can be in this line?THANK! I try to correct it!If I cant,please, say how i must correct!THANK!!! I cant correct!IF YOU can,help me!!!THANK!!!!! Edited by author 16.03.2007 19:22 THANK for hint! Edited by author 16.03.2007 22:21 NOW I HAVE MLE on 24 test! Use int instead of __int64 and you'll get AC! WOW!!!NOW I GOT AC!!!THANK to KIRILL(ArcSTU) & Romko [Lviv NU]!!!! Edited by author 16.03.2007 22:41 [code deleted] Edited by author 18.06.2007 16:58 [code delete] Edited by author 30.06.2007 15:04 |
| Why I get WA? Pelase, help me!!!!!!! | Revenger and NSC | 1072. Routing | 30 Jun 2007 14:27 | 6 |
There is my solution: Program t1072; Const MaxN=100; MaxK=10; Type TCPIP=record IP,Mask :array[1..4]of longint end; Var N,K,i,j,count :longint; S :string[255]; Route :array[1..MaxN,1..MaxN]of boolean; MinWay :array[1..MaxN]of longint; PredWay :array[1..MaxN]of longint; Comp1,Comp2 :longint; Next :longint; Way :array[1..MaxN]of longint; ex :boolean; net :array[1..MaxN]of record K :longint; TCP_IP :array[1..MaxK]of TCPIP; end; Function SameNet(_IP1,_IP2:TCPIP):boolean; var r1,r2,r3,r4 :boolean; begin r1:= (_IP1.IP[1] AND _IP1.Mask[1]) = (_IP2.IP[1] AND _IP2.Mask[1]); r2:= (_IP1.IP[2] AND _IP1.Mask[2]) = (_IP2.IP[2] AND _IP2.Mask[2]); r3:= (_IP1.IP[3] AND _IP1.Mask[3]) = (_IP2.IP[3] AND _IP2.Mask[3]); r4:= (_IP1.IP[4] AND _IP1.Mask[4]) = (_IP2.IP[4] AND _IP2.Mask[4]); SameNet:= r1 AND r2 AND r3 AND r4 ; end; Function InSameNet(comp1,comp2 :longint):boolean; var i1,i2 :longint; ok :boolean; begin for i1:=1 to net[comp1].K do for i2:=1 to net[comp2].K do if SameNet(net[comp1].TCP_IP[i1],net[comp2].TCP_IP[i2]) then begin InSameNet:=true; exit; end; InSameNet:=false; end; Procedure MakeTCP(S:string;Var D :TCPIP); var n1,n2,n3,n4 :longint; t1,t2,t3,t4 :longint; CurNum :string[255]; i,j,code :longint; begin j:=1; while S[j]=' ' do j:=j+1; CurNum:=''; for i:=j to length(S) do if S[i]<>'.' then CurNum:=CurNum+S[i] else break; j:=i+1; val(CurNum,n1,code); CurNum:=''; for i:=j to length(S) do if S[i]<>'.' then CurNum:=CurNum+S[i] else break; j:=i+1; val(CurNum,n2,code); CurNum:=''; for i:=j to length(S) do if S[i]<>'.' then CurNum:=CurNum+S[i] else break; j:=i+1; val(CurNum,n3,code); CurNum:=''; for i:=j to length(S) do if S[i]<>' ' then CurNum:=CurNum+S[i] else break; j:=i+1; val(CurNum,n4,code); while S[j]=' ' do j:=j+1; CurNum:=''; for i:=j to length(S) do if S[i]<>'.' then CurNum:=CurNum+S[i] else break; j:=i+1; val(CurNum,t1,code); CurNum:=''; for i:=j to length(S) do if S[i]<>'.' then CurNum:=CurNum+S[i] else break; j:=i+1; val(CurNum,t2,code); CurNum:=''; for i:=j to length(S) do if S[i]<>'.' then CurNum:=CurNum+S[i] else break; j:=i+1; val(CurNum,t3,code); CurNum:=''; for i:=j to length(S) do if S[i]<>' ' then CurNum:=CurNum+S[i] else break; val(CurNum,t4,code); D.IP[1]:=n1; D.IP[2]:=n2; D.IP[3]:=n3; D.IP[4]:=n4; D.Mask[1]:=t1; D.Mask[2]:=t2; D.Mask[3]:=t3; D.Mask[4]:=t4; end; begin Assign(input,'1072.in');ReSet(input); for i:=1 to MaxN do for j:=1 to MaxN do Route[i,j]:=false; Readln(N); for i:=1 to N do begin Readln(K); net[i].K:=K; for j:=1 to K do begin Readln(S); MakeTCP(S,net[i].TCP_IP[j]); end; end; Read(Comp1,Comp2); if comp1=comp2 then begin Writeln('YES'); Writeln(comp1); Halt(0); end; for i:=1 to N do for j:=1 to N do if i<>j then Route[i,j]:=InSameNet(i,j); for i:=1 to MaxN do MinWay[i]:=-1; for i:=1 to MaxN do PredWay[i]:=0; count:=0; MinWay[comp1]:=1; repeat ex:=true; count:=count+1; for i:=1 to N do if MinWay[i]=count then for j:=1 to N do if Route[i,j] then if MinWay[j]=-1 then begin MinWay[j]:=count+1; PredWay[j]:=i; ex:=false; end; until ex; if MinWay[comp2]=-1 then writeln('NO') else begin Next:=comp2; j:=MinWay[comp2]+1; while Next<>0 do begin j:=j-1; Way[j]:=Next; Next:=PredWay[Next]; end; writeln('YES'); i:=0; for i:=1 to MinWay[comp2]-1 do write(Way[i],' ') |
| Need prompting!! | AB&B | 1550. Dean's Pyramid 3 | 30 Jun 2007 14:22 | 2 |
I just finding volume of the pyramid and deducting volume of truncated cylinder, but getting WA (4 test). Can anyone to give me a prompting (not solving :)), please? I found mistake! I took PI=3.1415926535 instead 3.14159 and get AC :) |
| How to solve this not through simplex method | Kraev Alexey | 1449. Credit Operations 2 | 30 Jun 2007 05:00 | 4 |
Is it reduced to flow or matching ? Hint: you can find the minimum total amount of all bribes (but not the optimal values of bribes) if you know the solution of problem 1076. Good luck! Thank you, i tried to construct algo using this idea, but the second stage of that algo was wrong. Now i fixed it and got ac. Thank you! It is solvable by simplex algorithm!? Result must be non-negative integers, and integer resulted simplex is NP-complete problem. |
| Only latin letters??? | AndryS | 1404. Easy to Hack! | 30 Jun 2007 03:41 | 1 |
Also what here it is wrong??? You see only latin letters!! using System; class Program { static void Main(string[] args) { string s = Console.ReadLine();
if (s != null) { int[] s1 = new int[s.Length]; int[] s3 = new int[s.Length]; string s2 = "abcdefghijklmnopqrstuvwxyz"; int tmp = 26; for (int i = 0; i < s.Length; i++) { if (i == 0) { s1[i] = s2.IndexOf(s[i]); if (s1[i] <= 4) { s1[i] += 26; } } else { s1[i] = s2.IndexOf(s[i]); while (s1[i] < s1[i - 1]) { s1[i] += tmp; } } } tmp = s1[1]; int tmp1; s1[1] -= s1[0]; for (int i = 2; i < s1.Length; i++) { tmp1 = s1[i]; s1[i] -= tmp; tmp = tmp1; } s = ""; s1[0] -= 5; for (int i = 0; i < s1.Length; i++) { s += s2[s1[i]]; } } Console.WriteLine(s);
} } |
| std::prev_permutation | Lomir | 1425. Queen 2 | 30 Jun 2007 01:55 | 1 |
http://www.cplusplus.com/reference/algorithm/prev_permutation.html"If the function can determine the previous smaller permutation, it rearranges the elements as such and returns true. If that was not possible (because it is already at the smallest), it rearranges the elements according to the last permutation (sorted in descending order) and returns false." On Timus std::prev_permutation function doesn't return false ever. This code gets TLE: std::vector<int> v(5); for (int i = 0; i < 2; ++i) v[i] = 1; while (std::prev_permutation(v.begin(), v.end())); |
| What's the meaning of the problem? | xcheng | 1001. Reverse Root | 29 Jun 2007 19:14 | 2 |
I'm stupid,but I want you to tell me. I got it ,sorry for troubling. |
| What answer on thi test? | Neizvestnii | 1217. Unlucky Tickets | 29 Jun 2007 11:16 | 1 |
n=14 n=16 n=12 Please help me! |
| If you keep on getting MLE | Olzhas2dy | 1306. Sequence Median | 29 Jun 2007 02:22 | 1 |
This one is a really tough one. Even though solving it was kind of fun, I really got tired of it. I used a heap. I also tried priority_queue<T> template, but for some reason I was just keep on getting MLE on the test #7. I really don't know how other people made a good use of priority_queue<T>. My advise is simple - just use binary heap with "add to a heap" and "delete from a heap" operations. If you don't know what it is visit this site " http://en.wikipedia.org/wiki/Binary_heap"(I would pay attention to the part where the author describes an array implementation of it). Good luck. |
| My Answer | deepbluesea | 1123. Salary | 28 Jun 2007 20:19 | 1 |
Edited by author 28.06.2007 20:21 |
| Crash #1 | MySure | 1269. Obscene Words Filter | 28 Jun 2007 19:27 | 1 |
I got crash on test 1 Is test 1 the sample? I passed the sample.. why? |
| Changes in the problem 1211 "Collective guarantee" (+) | Sandro (USU) | 1211. Collective Guarantee | 28 Jun 2007 14:53 | 6 |
The old limitations were 1000 tests in multitest and 25000 childs in one test. There are no more than 16 tests in multitests now. Tests were seriously updated (in fact only Test#1 and Test#2 were not changed). About 300 authors lost their AC after rejudge. Good job. My previous solution was too slow. now I have AC. I don't understand: my solution on Pascal is wrong now (stack-overflow), but my solution on C is AC as well as before test-updating... I will think about it... Maybe it's need just change stack size... ------------------------- AC now. Only "{$M 16777216}" corrected my program. (sorry for my bad english) Edited by author 27.06.2007 01:31 Edited by author 27.06.2007 01:36 To JTim: You are right! First I have received Crash stack-overflow on 7 test, then I have added {$M 16777216} in my program and have received AC! Very mysterious rejudge... My first CORRECT and FAST solution now gets WA #1. Or compilers have changed ever since??? Edited by author 28.06.2007 01:39 Yes, Pascal compiler has changed since 2004, compiler options in your code are invalid now. Of course, your solution was not the aim of rejudge. |
| No subject | Ghirinovski | 1263. Elections | 28 Jun 2007 14:36 | 1 |
#include<stdio.h> int main() { long int i,n,m,x; scanf("%d", &n); scanf("%d", &m); int a[20000]={0}; for(i=1;i<=m;i++) {scanf("%ld", &x);a[x]++; } for(i=1;i<=n;i++) { printf("%.2f%%\n",(double)((double)a[i]*100/(double)m)); } return 0; } |