Common Board| Show all threads Hide all threads Show all messages Hide all messages | | Where is the error in the logic? | 3,14 | 1023. Buttons | 31 Aug 2007 21:24 | 3 | Let "n + 1" is the number of turns which were made during the game. Then to make the make second player winner the set of inequalities should be correct: - |k - n <= L < k - nL > 0 | n mod 2 = 1 - So our task is to find max odd n, where k / n > k - n > 0 I wrote the program which solves this set of inequalities but got an error on the test #3. I argued on another: Let k is max how many it is possible to take, then the second can make so each time by both would be taken k+1 example: k=5 1-3 2-3 1-5 2-1 And in a result it is necessary to find min k (n mod (k+1)=0) It is easy Good luck!!! I have tried to write such prog. But it gives WA#11. | | Crash (access violation) | Hayk Blrtsyan | 1413. Mars Jumper | 31 Aug 2007 17:35 | 2 | I do evrything, but I get Crash (access violation)on test6 Here is my code in C++ Pleaz HEEEEELP me !!! #include <stdio.h> #include <string.h> #include <math.h> #define d sqrt((double)2)/2 double dx[] = { 0,-d,0,d,-1,0,1,-d,0,d }; double dy[] = { 0,-d,-1,-d,0,0,0,d,1,d }; double x, y; int n, i; char s[250005]; int main() { scanf("%s", &s); n = strlen(s); for(i = 0; i < n; i++) { if(s[i] == '0' || s[i] == 13) break; x += dx[s[i]-48]; y += dy[s[i]-48]; } printf("%.11lf %.11lf\n", x, y); return 0; } Edited by author 31.08.2007 16:37 "Not more than 1000000 digits from 0 to 9." Now count number of zeros here. It is 1kk (1 million). And your array is only 250005. Where have you found this number? It's defenetely not enough. | | hi, WA 12 ..... is any one know what the ... is in this test... | Alireza_Keshmiri | 1501. Sense of Beauty | 31 Aug 2007 15:58 | 1 | | | Does anyone has the test #6? (-) | Donat | 1511. Fiscal Operations | 31 Aug 2007 13:59 | 2 | I'm!!!! but down on 7th test | | Weak tests??? | Vedernikoff Sergey | 1130. Nikifor's Walk | 31 Aug 2007 02:45 | 1 | Simple brute-force solution gets AC. I think, tests may be improved to crash them. But in this case I don't know effective solution of the problem... | | Give me tests plz. I got WA on 2 test | Inside | 1048. Superlong Sums | 30 Aug 2007 23:43 | 1 | | | C++ | Valentin Pimenov | 1521. War Games 2 | 30 Aug 2007 19:21 | 1 | C++ Valentin Pimenov 30 Aug 2007 19:21 Can I use C++ feature "overloading of operator new" to increase the speed of memory allocation? | | WA#4 | Bespaly Evgeny | 1513. Lemon Tale | 30 Aug 2007 17:52 | 3 | WA#4 Bespaly Evgeny 29 Aug 2007 22:38 give me this test and it's result please. Re: WA#4 Bespaly Evgeny 29 Aug 2007 23:08 I am stupid :) now I have problems with WA#11 Edited by author 29.08.2007 23:09 Re: WA#4 Tolsha_Wizard 30 Aug 2007 17:52 | | What is answer on this tests?Thank!!! | CHIDEMYAN SERGEY | 1217. Unlucky Tickets | 30 Aug 2007 04:31 | 2 | 12 ans:3052783504 16 ans:23194144960900 Thank!!! Edited by author 30.08.2007 04:32 What answer,when n=14.Thank! | | Just simply Greedy | SerailHydra | 1431. Diplomas | 29 Aug 2007 23:56 | 3 | There is no need to use DP. Can your write proveness of Greedy for this problem? Dp as a rule absolute correct optimization method but greedy often well to next rejudgement. Yes!! AC Very hidden information needed: Dimploms of one type must be placed in one row. During a long time I thought that after changing conditions we can placed them in any different rows. Edited by author 24.01.2008 11:04 Let's try to proove it with one additional statement: "There is only one type of diploms with some size S". First we put all type of diploms in seperate lines. Now we must minimize the number of rows. By the problem description we have: We can merge two (x and y) rows into one if and only if equality is statisfied: |size(x)-size(y)| == 1 So, some diplom row x can be merged only with row y. Where: size(y) == size(x)+1 or size(y) == size(x)-1. If none of y diploms row exist, then row x can not be merged and it must stay. If only one dimplom row y exist, then we must do this megre not looking on y at all. Even if y has other possible merging global minimus isn't affected. If we can megre x and y or y and z, we can merge only one pair. The last type of merge left, then x can be merged from both sides. Here we cant choose the prefered merge so easily. So let's sort all rows and analise them in accessing order. Then this situation just can not happen, cause all size(y)-1 merging row will be merged before, then analysing Y row. Now lets apply this proof to out problem. We just have to divide all dimploms into sets. In set A goes all dimpols x with size(x) == A. So we must minimize the sum of all set's power by same apporach. | | The upper right and the lower left don't have to be connected !!! | Apiwat | 1033. Labyrinth | 29 Aug 2007 04:47 | 1 | Just want to concern who got WA in test 4. Coz, I waste my time for debuging it. Why don't someone add this imformation on the problem page. | | WA#7 | Loky_Yuri [USTU] | 1077. Travelling Tours | 28 Aug 2007 22:17 | 4 | WA#7 Loky_Yuri [USTU] 24 Aug 2007 15:58 I wrote this program and think this is right. But I have WA#7. I tested my program by many my own test. And it gives correct answer in 100% cases. May be someone can give me a test. This is my prog: [Code deleted by author] Edited by author 28.08.2007 22:14 Re: WA#7 Loky_Yuri [USTU] 25 Aug 2007 11:15 I'm still waiting for your help... Re: WA#7 AlexF [USTU Frogs] 28 Aug 2007 17:41 My friend, you should be more attentive)) 200 * 200 is much more bigger then 5000)) And please delete your AC code)) Edited by author 28.08.2007 22:43 Re: WA#7 Loky_Yuri [USTU] 28 Aug 2007 22:17 | | I wonder, why I get WA? Please, help me! | Nazarov Denis (nsc2001@rambler.ru) | 1130. Nikifor's Walk | 28 Aug 2007 19:47 | 3 | My program: Program t1130;{$N+} Const MaxN=10000; Var T :array[1..MaxN,1..3]of longint; N,i,j :longint; L :extended; Ci,Cj :extended; ex :boolean; begin FillChar(T,SizeOf(T),0); Ci:=0; Cj:=0; Read(N,L); for i:=1 to N do begin Read(T[i,1],T[i,2]); T[i,3]:=1; Ci:=Ci+T[i,1]; Cj:=Cj+T[i,2]; end; Repeat ex:=true; for i:=1 to N do if T[i,3]=1 then if Sqr(Ci-2*T[i,1])+Sqr(Cj-2*T[i,2])<Ci*Ci+Cj*Cj then begin T[i,3]:=-1; Ci:=Ci-2*T[i,1]; Cj:=Cj-2*T[i,2]; ex:=false; end else if Sqr(Ci+2*T[i,1])+Sqr(Cj+2*T[i,2])<Ci*Ci+Cj*Cj then begin T[i,3]:=1; Ci:=Ci+2*T[i,1]; Cj:=Cj+2*T[i,2]; ex:=false; end; if (ex)and(Ci*Ci+Cj*Cj>2*L*L) then begin T[N,3]:=-1*T[N,3]; Ci:=Ci+2*T[N,3]*T[N,1]; Cj:=Cj+2*T[N,3]*T[N,2]; ex:=false; end; Until ex; Writeln('YES'); for i:=1 to N do if T[i,3]=1 then Write('+') else Write('-'); Writeln; end. {$n+} Program Walk; Var i,j,k,m,n,bj:longint; x,y,z:double; a:array[1..10001,1..2] of integer; e:array[1..10001] of shortint; Begin fillchar(a,sizeof(a),0); fillchar(e,sizeof(e),0); read(n); read(z); x:=0; y:=0; for i:=1 to n do begin e[i]:=1; read(a[i,1],a[i,2]); x:=x+a[i,1]; y:=y+a[i,2]; end; while x*x+y*y-2*z*z>1e-14 do begin for i:=1 to n do if sqrt(x*x+y*y)-Sqrt(sqr(x-2*a[i,1]*e[i])+sqr(y-2*a[i,2]*e[i])) >1e-14 then begin x:=x-2*a[i,1]*e[i]; y:=y-2*a[i,2]*e[i]; e[i]:=-e[i]; if 2*z*z-x*x-y*y>1e-14 then break; end; end; writeln('YES'); for i:=1 to n do if e[i]=-1 then write('-') else write('+'); writeln; End. Dont believe this programm it gets TLE on test12 | | WHY WA on Test#14???? | check | 1036. Lucky Tickets | 28 Aug 2007 18:25 | 1 | Who can give me that test? | | Thank you | nickolas stoudemire | 1244. Gentlemen | 28 Aug 2007 11:01 | 1 | Thank you nickolas stoudemire 28 Aug 2007 11:01 Thank you to the ones who provide some tests. | | What is wrong? C++ WA2 Pascal WA3 | alext | 1413. Mars Jumper | 28 Aug 2007 00:57 | 3 | wtf?? My equal solutions on Pascal and C++ has WA on tests 3 and 2. Why? I used some formulas - sqrt(2)/2, cos(pi/4), and others. May be, error in real types (I used some variants: Pascal - extended C++ - double, long double ) I read other topics about this problem, but I have not AC :) Thanks. I used: const double root = sqrt(2.0)/2.0; Ups.. double post.. Edited by author 28.08.2007 00:57 | | PLEASE TEST MY PROGRAM! | Bychkov=>[ProgMyaZzz] | 1190. Bar of Chocolate | 27 Aug 2007 20:55 | 1 | WA Test 9. Can anyone test my program? Anyone know what is the test #9? | | Compilation Error (C#) | Black^n^White | 1295. Crazy Notions | 27 Aug 2007 15:34 | 4 | It runs well on MS Visual C# 2005, but here i get CE using System; using System.Text; class Program { static void Main() { ulong n = ulong.Parse(Console.ReadLine()); ulong sum = 1; ulong ans = 0; ulong a = 2, b = 3, c = 4; ulong a1 = 1, b1 = 1, c1 = 1; for (ulong i = 1; i <= n; ++i) { a1 *= a; a1 %= 1000; b1 *= b; b1 %= 1000; c1 *= c; c1 %= 1000; } sum += a1 + b1 + c1; while (true) { if ((sum % 10) == 0) { ans++; } else { Console.WriteLine(ans); break; } sum /= 10; } } } Edited by author 30.01.2007 15:26 Say you what you write on c# Edited by author 21.03.2007 14:23 Really compilation error? I sent your solution for problem 1000 and it was compiled (I got crash on 1 test). Be sure that you selected correct langyage during submitting Edited by author 21.03.2007 16:47 man put instead of true sum != 0 | | Is it possible such an input??? Problem 1195 | Vladimir Milenov Vasilev | 1195. Ouths and Crosses | 27 Aug 2007 15:02 | 3 | IS it possible such an input? OOO XX# X## No I have answers to all your questions :) 5 Mar 2002 20:58 I think no. It is finished . | | Why Compile Error | Hayk Blrtsyan | 1446. Sorting Hat | 27 Aug 2007 14:19 | 3 | Here is my solution in C++ I delete my solution becouse I resive ansver . Edited by author 27.08.2007 14:22 Edited by author 27.08.2007 14:22 Look at attentively =) >> printf("%s\n", l[3][i]); printf("\n");s (symbol 's' in the end of string) |
|
|