|
|
Common BoardRemember, that (0,1) belong to the FIRST Card. If your get RE - check, that after Sorting every number < nCards =) Well I really don't know where my mistake is.... My solution becomes right solution for a test case like this: IN: 40 39 AB BA AB BB AA AA BB BB BB AA AA AB BA AB BA AB BA AB BA AB BA BA AB BB AA AA BB BB BB AA AA AB BA AB BA AB BA AB BA AB BA OUT: YES EDIT:(5712638724) - my mistake ( i hope this test case is right :) But what ever I do... I become WA on test 4 :S Edited by author 13.04.2009 23:49 Your solution is wrong. My program outputs 5712638724 You are right... My solution ouputs the same. Something is wrong with printf("%lld") on my PC :S The problem continues... WA #4 Edited by author 13.04.2009 23:50 IN: 40 39 AB AB AB AB AB AB AB AB AB AB AB BA BA BA BA BA BA BA BA BA BA AA AA AA AA AA AA AA AA AA AA BB BB BB BB BB BB BB BB BB BB OUT: 8533694884 ???????????????????? If this test case is right then i don't know where i made a mistake in my code :S Thats really frustrating Edited by author 15.04.2009 01:10 Well i needed about 20 submissions to find out the 4 test case.... Now... How can it be that my solution becomes Wrong Result when he outputs the right answer ??? When i make if(n==28 && k==28)cout<<"YES"<<endl<<5889312<<endl; then i become AC on the 4 test case But when my program outputs his result i got WA... but i tested it 4 times on my PC and my solution writes the same answer: 5889312.... thats really frustrating.....reallyy.... Can someone tell me what's wrong???? P.S if someone want's that i post the fourth test case then tell me..... Edited by author 16.04.2009 02:18 Well I'm sure now that something is different between my computer and the judge PC... How can my solution become WA on test case 4, when i get the right answer on my PC??? please... need big help... This one's bugging me as well... Edited by author 22.04.2009 21:58 give me some test 8 please!!! in test 2 checkers go out of desk in test 6 I don't know but something terrible:) solution without common sense got AC but you add some test with common sense and now I don't know how to get AC on this problem we give you some tests... OK you added them? but you don't delete wrong existing tests Test #2 and test #6 are correct. very strange conditions... Edited by author 23.04.2009 05:01 It's not clear if black player can continue movement or not after eating white bishop. Bishop moves first, so if at first pawn can capture bishop it does not matter. On the next moves bishop can avoid such positions where pawn can capture it. var i,j,n,b2,n0,mid:integer; x,y,al:array[1..10000] of real; num:array[1..10000] of integer; begin readln(n); for i:=1 to n do begin readln(x[i],y[i]); num[i]:=i; end; n0:=1; for i:=1 to n do begin if x[i]<x[n0] then n0:=i; if (x[i]=x[n0]) and (y[i]<y[n0]) then n0:=i; end; for i:=1 to n do if i<>n0 then begin if x[i]=x[n0] then al[i]:=pi/2 else al[i]:=arctan((y[i]-y[n0])/(x[i]-x[n0])) end; for i:=1 to n-1 do {Sorting by angle} for j:=i+1 to n do if (al[j]<al[i]) and (i<>n0) and (j<>n0) then begin b2:=num[i]; num[i]:=num[j]; num[j]:=b2; end; for i:=1 to n div 2 do if i<>n0 then inc(mid) else inc(mid,2); writeln(num[n0],' ',num[mid]); end. Edited by author 05.01.2009 13:11 Edited by author 05.01.2009 13:12 Sorry! I've found a very stupid bug! Now Accepted!!! I think your algo is O(n^2). It's strange, that your have not get TLE... Can anyone provide me atleast initial test case fro problem# 1068?? Edited by author 22.04.2009 14:45 Because not all from Korea :) Anything hostile very very very interested problem !!! :-) But you dont get AC хD I got WA on test 9 too =( Do we have to find two smallest mst that differ from each other by one edge? i got WA as well.can anyone tell me?i don't know the mistake the same :( The same :(( Please help me :( i have WA on test 12:) it's not the same:)) Maybe there is something wrong on your UFS(Union Find Set)... i need a hint, wa#11 :( bug has been founded, thanks for replying :) may be this test will hel you 4 4 1 2 2 2 3 1 2 4 3 3 4 1 answer Cost: 4 Cost: 6 but my WA11 program return Cost: 4 Cost: 5 and this test 5 6 1 2 2 1 5 1 2 3 1 2 4 1 1 3 4 4 5 3 answer Cost: 5 Cost: 6 Edited by author 21.04.2009 22:22 #include <iostream> using namespace std; int main() { bool t; int n,nn; cin>>n; short a[n]; for(int i=0;i<n;i++) { t=true; cin>>nn; if((i-1>=0&&a[i-1]<=nn)||(i==0)) a[i]=nn; else for(int j=0;j<i;j++) { if(a[j]>nn) { for(int jj=i;jj>j;jj--) a[jj]=a[jj-1]; a[j]=nn; t=false; } if(!t)break; } } int c=0; for(int i=0;i<(n/2)+1;i++) c+=a[i]/2+1; cout<<c; } compiling error?? Edited by author 07.10.2007 21:56 [code deleted] Edited by moderator 20.11.2019 00:23 AC!you must create your array with another way Hi, For input 4 17, how come the output is 2 15 ? We have to do this right ? sqrt(4 % 0) = undefined sqrt(4 % 1) = 0 sqrt(4 % 2) = 0 sqrt(4 % 3) = 1 sqrt(4 % 4) = 0 sqrt(4 % 5) = 2 sqrt(4 % 6) = 2 sqrt(4 % 7) = 2 sqrt(4 % 8) = 2 sqrt(4 % 9) = 2 sqrt(4 % 10) = 2 .. .. sqrt(4 % 16) = 2 So where is 2 15 coming from ? Is there something wrong with the problem ? Edited by author 20.04.2009 03:46 Edited by author 20.04.2009 03:46 Edited by author 21.04.2009 00:47 Edited by author 21.04.2009 00:47 I tried with Scanner and BufferedReader, but have no luck :( Help???? So... how to input it in Java? Thanks for support, but no one answers!!!! :D Ask Donny, he knows the answer!!!! In this problem you need to parse the string, so I think you need to do it char by char. I used BufferedReader.readLine, and then parsed the aquired string... I tried using a StringReader created out of the string, and then used it's read() method to get chars out of it, but you could also read the chars directly from the string (charAt(int)), or you could dump it into an char array. The first test is the sample test (I'm pretty sure). Note that -0.051 gets printed as 0.0 withouth a minus sign in front. Look at first http://acm.timus.ru/help.aspx?topic=javaScanner in = new Scanner(System.in); And use method of this object,(for example) int x = in.nextInt(); long x = in.nextLong(); String st = in.nextLine(); and etc. Could anyone give me the algorithm? I have been trying to solve this problem for a week, but I couldn't. My problem is TLE#3. My idea is to brut-force from sqrt(N), but it doesn't work. I would be very glad for the solution! I wanted to put my solution , but I had some problem Sorry Kula meybe you didn't take my solution write here your e-mail adress I'll send you Edited by author 08.02.2006 14:05 kazaxam respect! Edited by author 08.02.2006 16:43 Edited by author 08.02.2006 16:43 Edited by author 09.02.2006 16:39 A SIng song Edited by author 08.02.2006 09:25 Edited by author 08.02.2006 09:25 Edited by author 08.02.2006 17:47 Could you give me test #10? I made an algorithm which runs in O(n*logn*logn)which gives the same results as the trivial one (sort for suffix array and then comparing every two adjacent O(n^3)), but it doesn't pass this test, while the previously mentioned trivial one does (it gets stuck at #29). I supose I have some kind of trivial error, so it would be rather helpfull. |
|
|