Show all threads Hide all threads Show all messages Hide all messages |
WA3 | Oleksandr | 1823. Ideal Gas | 15 Jan 2012 05:26 | 2 |
WA3 Oleksandr 15 Jan 2012 05:25 if n or p or T or V not integer then error or some value? Edited by author 15.01.2012 05:32 Re: WA3 Oleksandr 15 Jan 2012 05:26 |
WA 6 ????? | Михаил | 1870. Zinium 2 | 15 Jan 2012 04:25 | 4 |
Some tests: n - answer 15 - No 99 - No 23 - Yes 97 - Yes 16 - No wa20 BaJIuK 15 Jan 2012 04:25 if you have WA20 try this tests :) 25 YES 145 YES 9991 YES 9995 YES |
No subject | Irina | 1045. Funny Game | 15 Jan 2012 02:57 | 1 |
Edited by author 08.04.2012 20:51 |
I have too WRONG ANSWER(((help me!!!! | yerkubekov | 1001. Reverse Root | 14 Jan 2012 21:05 | 3 |
#include <iostream> using namespace std; int main() { double a,b,c,d; cin >> a >> b >> c >> d; cout << sqrt(d) << endl << sqrt(c) << endl << sqrt(b) << endl << sqrt(a) << endl;
return 0; } yes i also have done with 4 numbers now i am in a fix how to terminate it with undefined number set....help me... |
WA #13 | Hi4ko | 1642. 1D Maze | 14 Jan 2012 20:54 | 2 |
why? #include <iostream> #include <cmath> using namespace std; #define SWAP(A, B) { int t = A; A = B; B = t; } void bubblesort(int *a, int n) { int i, j; for (i = n - 1; i > 0; i--) { for (j = 0; j < i; j++) { if (a[j] > a[j + 1]) SWAP( a[j], a[j + 1] ); } } } int main() { int n,x,ar[100]; cin>>n>>x; for(int i=0;i<n;i++) cin>>ar[i]; bubblesort(ar,n); int j=0; while(ar[j]<0 && j<n-1) ++j; if(ar[j-1]<x && ar[j]>x && n!=1 ) { if(x<0) cout<<2*ar[j]-x<<" "<<0-x; else cout<<x<<" "<<abs(2*ar[j-1])+x; } else if(n==1) { if(ar[0] > x) cout<<2*abs(ar[0])-x<<" "<<-x; else cout<<x<<" "<<2*abs(ar[0])+x; } else cout<<"Impossible"; } I am also get WA#13.I don't understand why. Please help me. My code is #include"iostream" using namespace std; int main() { int x[100]; int n, x0; cin>>n; cin>>x0; if(n==0){cout<<"Impossible"; return 0;} for(int i=0;i<n;i++) cin>>x[i]; if(n==1) { n=2; x[1]=x0; } for(int i=0;i<n;i++) for(int j=i+1;j<n;j++) if(x[j]<x[i]) { int t=x[i]; x[i]=x[j]; x[j]=t; } int i=0; for(;i<n-1;i++) { if(x0>=x[i]&&x0<=x[i+1]) { if(x[i]<=0&&x[i+1]>=0) { if(x0>0) { cout<<x0<<' '<<x0+abs(2*x[i]); return 0; } else { cout<<2*x[i+1]+abs(x0)<<' '<<abs(x0); return 0; } } } } cout<<"Impossible"; return 0; } |
When TLE 24 | AterLux | 1546. Japanese Sorting | 14 Jan 2012 19:41 | 2 |
It is "antiquicksort" test. Use pivot differ from (bottom + top) / 2, for example, random choosed. maybe it's "antiquicksort" test. I use anti("antiquicksort" test) coding =) for( long i=0; i < 1e6; ++i ) swap( v[rand()%v.size()], v[rand()%v.size()] ); where 'v' is vector of string. =) Edited by author 14.01.2012 19:42 Edited by author 14.01.2012 19:42 |
Very nice problem!!!! Thanks a lot to authors, I enjoyed !!!!! | xurshid_n | 1802. Cube Puzzle | 14 Jan 2012 18:15 | 1 |
AC 0.031 s. 156 Kb. Edited by author 14.01.2012 18:16 Edited by author 14.01.2012 18:18 |
Qsort??? | sokoL[TSOGU™] | 1510. Order | 14 Jan 2012 14:17 | 4 |
Qsort??? sokoL[TSOGU™] 13 Oct 2009 16:50 I used q_sort and have time limit 15? And I used stl sort and got AC. Decides it is problem with Q_sort? There is a linear solution. Without sorting. how use q sort in this problem? please help me.for q sort it's need very big (1..10^9) array and it's not able in pascal. |
AC TEST 19 | Iacob Vlad | 1510. Order | 14 Jan 2012 14:14 | 2 |
program order; var n,ap,i,j:longint; x:array[1..10000] of real; begin readln(n); for i:=1 to n do readln(x[i]); i:=1; while i<=n do begin ap:=1; for j:=i+1 to n do if x[i]=x[j] then ap:=ap+1; if ap>(n div 2) then begin writeln(x[i]:0:0); break; end else i:=i+1; end; end. my algo need less time but i got TLE on test 19 . Then i was interested and send your solution . At first your array size was very small and at second time it got TLE on test 19. So sorry, but it's not solution. |
looking for help...... WA#2 | williamljb | 1207. Median on the Plane | 14 Jan 2012 13:07 | 4 |
program p1207; uses math; type realer=record rr:real; num:longint; end; var i,j,k,n,m,x,y,x0,y0:longint; r:array[1..10000]of realer; procedure qs(h,t:longint); var i,j:longint; k:real; o:realer; begin if h>=t then exit; i:=h;j:=t;k:=r[(i+j)div 2].rr; repeat while r[i].rr<k do inc(i); while r[j].rr>k do dec(j); if i<=j then begin o:=r[i]; r[i]:=r[j]; r[j]:=o; inc(i); dec(j); end; until i>j; qs(h,j); qs(i,t); end; begin readln(n); readln(x0,y0); for i:=2 to n do begin readln(x,y); x:=x-x0; y:=y-y0; if x=0 then if y>0 then r[i-1].rr:=0.5*pi else r[i-1].rr:=-0.5*pi else r[i-1].rr:=arctan(y/x); r[i-1].num:=i; end; qs(1,n-1); writeln(1,' ',r[n div 2].num); end. Any hints or tests can be helpful! Thanks! This test helped me to kill WA2 2 1 1 -1 -1 And don't forget about size of types! test BaJIuK 14 Jan 2012 13:07 4 -999999999 1000000000 -1000000000 999999999 1000000000 -1000000000 -1000000000 1000000000 out: 3 4 |
hint | Anton | 1126. Magnetic Storms | 14 Jan 2012 02:10 | 2 |
hint Anton 12 Nov 2011 07:33 Segment tree can help solve the problem. I've got AC 0.046s 512Kb. My steps: 1. Read all input and build segment tree 2. Get rmq(i, i + m - 1) for all needed i Re: hint IgorKoval(from Pskov) 14 Jan 2012 02:10 I cann't believe. It DON'T get TLE. for( long i = m-1; i < (long)arr.size(); ++i ) cout << *max_element( arr.begin()+i+1-m, arr.begin()+i+1 ) << endl; =) |
Can't understand first sample | George Agapov | 1710. Boris, You Are Wrong! | 13 Jan 2012 21:53 | 1 |
Look, using the theorem we could build a triangle with such vertexes: NO -1.0000000000 4.0000000000 0.0000000000 0.0000000000 -0.8780487805 3.9024390244 (img: http://ge.tt/9klV3HC/v/0 ) |
vaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa | My name is KHON | | 13 Jan 2012 19:50 | 1 |
hiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii |
The N is too large to use an array... Do you have any ideas? | Moya | 1465. Pawn Game | 13 Jan 2012 18:16 | 5 |
I'll give you two hints: 1) You must be familiar with nimbers. 2) Look for a cycle. I used another program to find a cycle when generating nimbers up to let's say 10 000. Good luck ;) can you tell me what the cycle is? thanks. The sequence of answers is periodic(period length=34). But it becomes periodic from a certain position. can you send your AC code to me?please to this e-mail: mwhaea123456@163.com Thank you so much |
WA#3 | Nick | 1313. Some Words about Sport | 13 Jan 2012 17:20 | 1 |
WA#3 Nick 13 Jan 2012 17:20 #include "iostream" using namespace std; int main() { int n; cin>>n; int ar[101][101]; for(int i=0;i<n;i++) for(int j=0;j<n;j++) cin>>ar[i][j]; cout<<ar[0][0]<<' '; for(int i=1;i<n;i++) { int b=0; for(int j=i;j>=0;j--) { cout<<ar[j][b]<<' '; b++; } } for(int i=1;i<4;i++) { int b=n-1; for(int j=i;j<n;j++) { cout<<ar[b][j]<<' '; b--; } } return 0; } Help me! |
Why can not AC? | zj_zcy | 1023. Buttons | 13 Jan 2012 14:06 | 5 |
var n,i,j:longint; begin readln(n); if (n<=2)then begin writeln('0') ; halt; end; j:=trunc(sqrt(n)); for i:=3 to j do begin if (n mod i=0) then break; end; writeln(i-1); end. Can anybody tell me why? It seems rigth^Why ? It drives me crazy^ Edited by author 15.06.2008 14:10 Edited by author 15.06.2008 14:10 I think your j should be n div 2,and I promise it's not TLE.And you can define 'ans' to store the answer and let it equal n.That's all. zj_zcy, what if n = 3 ? Your program wrote 0, but right answer 2 The trouble is if n is big prime. Try this: 99999989 The answer is: 99999988. Think how to modify algorithm to catch big primes in factorization. Here it isn't necessary, but it will be useful. Your code will possibly fail for integers like 2*n,also for test cases where n is a prime number |
Can be this case? a=b<c=d<e=f. | Hrayr | 1142. Relations | 13 Jan 2012 03:42 | 3 |
Apply the GOOD JOB for College ACMers to Make Large Money and Become a Millionaire Hello, We need large no. of dedicated and hard working ACMers. The payment is good so we need ACMers to be efficient. All you have to do to get the job is to sign up at our websites. The link of our websites are given below. http://www.PaisaLive.com/register.asp?3556638-4847933 After the registration, a confirmation email will be sent to your specified email address. Please click on the link inside the confirmation email to activate your account and recieve ACM work instantly. For any other queries you can mail the administrator. Miss Juliet Admin paisalive.com Yes, you can have this case. Your hint has helped my solve the problem. KEYWORDS: Stirling numbers of 2nd kind, Factorial |
What input in test 3? | Ananas | 1496. Spammer | 12 Jan 2012 22:03 | 1 |
0 Edited by author 12.01.2012 22:05 |
Visual Basic | Christiaan | | 12 Jan 2012 21:39 | 1 |
Does any one know if 2008 will also work? or must you use 2010? |
It's nice problem | Qodirov Nodir [ Tashkent U of IT ] | 1260. Nudnik Photographer | 12 Jan 2012 21:07 | 2 |
1 1 2 4 6 9 14 21 31 46 68 100 147 216 317 465 682 1000 1466 2149 3150 4617 6767 9918 14536 21304 31223 45760 67065 98289 144050 211116 309406 453457 664574 973981 1427439 2092014 3065996 4493436 6585451 9651448 14144885 20730337 30381786 44526672 65257010 95638797 140165470 205422481 301061279 441226750 646649232 947710512 |