Show all threads Hide all threads Show all messages Hide all messages |
WA on test #28 | Shen Yang | 1399. Economical Director | 14 Dec 2016 20:03 | 5 |
any one help?? I need help... I use radom to generate 200 chain list,and then cut the chain list, using O(polynomial) dynamic programming, it is WA on test # 26, then I use regular brute_force search times>=1e7 return, it WA on test #28... anyone give some ideas?? I think cut the chain method get WA is because though between two rows there is at most one same buyer, but there maybe more then two rows have same buyers for exmaple ,structure of solution maybe 0--1---2--3--4--5---0 0--1--6--0 0--2--7--0 0--3--8--0 0--4--9--0 0--5--10--0
Edited by author 14.12.2016 14:14 AC now it is some stupid bugs on my code?? btw , I think this problem is much easier than ural 1394 why not find accuarcy solution? |
Puzzled by test #5 | deserts | 1093. Darts | 14 Dec 2016 19:56 | 5 |
I'm sure my source code is perfect. But it never passed test #5. Can anyone help me? #include <stdio.h> #include <math.h>
int main() { double cx,cy,cz,nx,ny,nz,r,sx,sy,sz,vx,vy,vz,t; double x,y,z; double a,b,c; int hit; scanf("%lf %lf %lf %lf %lf %lf %lf %lf %lf %lf %lf %lf %lf",&cx,&cy,&cz,&nx,&ny,&nz,&r,&sx,&sy,&sz,&vx,&vy,&vz); b=nx*vx+ny*vy+nz*vz; c=nx*(sx-cx)+ny*(sy-cy)+nz*(sz-cz); a=-5*nz; if(b*b-4*a*c<-1e-8) printf("MISSED\n"); else if((b+sqrt(b*b-4*a*c))/nz<-1e-8 && (b-sqrt(b*b-4*a*c))/nz<-1e-8) printf("MISSED\n"); else { hit=0; t=(b-sqrt(b*b-4*a*c))/(10*nz); if(t>1e-8) { x=sx+vx*t; y=sy+vy*t; z=sz+vz*t-5*t*t; if(r-sqrt(pow(x-cx,2)+pow(y-cy,2)+pow(z-cz,2))>1e-8) ++hit; }
t=(b+sqrt(b*b-4*a*c))/(10*nz); if(t>1e-8) { x=sx+vx*t; y=sy+vy*t; z=sz+vz*t-5*t*t; if(r-sqrt(pow(x-cx,2)+pow(y-cy,2)+pow(z-cz,2))>1e-8) ++hit; } if(hit) printf("HIT\n"); else printf("MISSED\n"); } return 0; } I couldn't pass fifth test too, and I had mistake described above. Maybe, there is another mistake in your program. The test 5 in TIMUS is the case when the trace of dart only touches the dartboard in one point (i.e. like the parabola touches the plane). When I had understood this fact I got AC. Edited by author 21.03.2009 17:26 Edited by author 21.03.2009 17:26 So if it touches the plane should we consider it as a hit? My solution also fails WA#5 and I don't understand why... any hints guys? |
How to get 0.001 sec? | Alexey | 1052. Rabbit Hunt | 14 Dec 2016 01:12 | 2 |
I solved it in 0.015 with g++, but i can't optimize anymore Edited by author 22.06.2015 13:32 |
Easy problem! | Majin Boo | 1370. Magician | 13 Dec 2016 22:52 | 1 |
It's just the array rotation problem asked of a different way. |
Help Needed | Toufik Zaman | 1577. E-mail | 13 Dec 2016 17:53 | 2 |
Please help me with test case 16 |
Test #12 Output Limit Exceeded | Cebotari Vladislav | 1074. Very Short Problem | 13 Dec 2016 14:59 | 1 |
Hey guys any hints here? All examples from forum works on my program but this one exceeds. I guess it's because more than 200 characters are written, but I cannot find any test case that will require less written characters but the output will have more length |
WA 2 | Combatcook | 2106. Deserialization | 12 Dec 2016 16:36 | 3 |
WA 2 Combatcook 12 Dec 2016 01:57 Does anyone know some tests to overcome WA 2? Re: WA 2 Jane Soboleva (SumNU) 12 Dec 2016 07:23 Fixed mine after realizing that FFFFFFFF won't fit properly into a signed type. Thanks, Jane, the same problem - forgot to replace longint on int64 before submit :) |
Accepted for changing the reading | 4EJ | 1846. GCD 2010 | 11 Dec 2016 11:04 | 1 |
I use a sement tree, gave tle in test 17 and when I changed the scanf by the following "std :: ios :: sync_with_stdio (false)" I have acepted with time of 0.358 s |
Regarding a result - The sequence of ships in each row should also be ordered in a certain way. | organmusic | 1394. Ships. Version 2 | 11 Dec 2016 07:20 | 1 |
Since there can be more than one acceptable solution, I think, it could give a more unambiguous result. |
why "wa #11"? | lian lian | 1642. 1D Maze | 10 Dec 2016 18:06 | 5 |
who could give some testdata to me ? 3 3 9 10 11 result? Edited by author 05.11.2008 04:11 My program have WA#11, please help? I think that test is incorrect in previous post! I've got AC. Try test like: 1 -1 100 Result:201 1 1 1 -100 Result:1 201 @lian lian that test is wrong,because the problem says,that there exists answer in any ocassion,but in this test you don't have negative values,so you can't count the quantity of moves... Edited by author 09.07.2010 17:03 3 2003 Edited by author 10.12.2016 18:09 |
где ошибка? | Nick | 1025. Democracy in Danger | 10 Dec 2016 03:24 | 3 |
using System; class Program { static void Main() { int t = int.Parse(Console.ReadLine()); string[] s = Console.ReadLine().Split(' '); Array.Sort(s); int r = 0; for (int i = 0; i < (t / 2)+1; i++) { r += ((int.Parse(s[i]) / 2) +1); } Console.WriteLine(r); } } Edited by author 16.06.2012 19:10 Edited by author 16.06.2012 19:11 You must input all the array first, and only then work with it Edited by author 10.12.2016 03:26 |
Timing results | Megakrit | 1263. Elections | 9 Dec 2016 02:10 | 3 |
Hi, folks! Can anyone give me the source code in C# of this task (mine is already AC) when the timing is less than 0.1 sec? Or can anyone give me the key notes how it can be decreased in almost ten times? Thanks in advance! I presume your sol is O(NM), right? Think a bit. There is O(N+M) solution which definitely has time better than 0.1 sec. 1) Be sure that your algorithm is O(N+M) 2) When calculating percents you should not do: value * 100 / number inside cycle, it is better to calculate "100.0 / number" one time before cycle and then just perfom multiplying. 3) I used float for keeping values, not int. I think it saves time of casting from int to float. When I used 2 and 3 my time for c# decreased from 0.109 to 0.046. |
WA in test #2 C++ | LasTAD | 1263. Elections | 9 Dec 2016 01:31 | 2 |
#include <iostream> using namespace std; int main() { int cand, ch; cin >> cand >> ch; int* Ch = new int[ch]; double* Cand = new double[cand]; for (int i = 0; i < cand; i++) { Cand[i] = 0; } for (int i = 0; i < ch; i++) cin >> Ch[i]; for (int i = 0; i < ch; i++) { Cand[Ch[i]-1] += 1; } for (int i = 0; i < cand; i++) { printf("%.2f%%\n", (Cand[i]/6.0)*100.0); } } +++++++++++ Why this isn't work? What is the hardcoded value "6" in your code? |
What's wrong with it?I am getting WA. | Ram Prakash P | 1020. Rope | 8 Dec 2016 19:54 | 2 |
#include <iostream> #include <cmath> #include <iomanip> using namespace std; int main() { int i,j,N,p; std::cin>>N; float cd[N][2],R,dist = 0.0; std::cin>>R;
for(p = 0;p < N;p++) std::cin>>cd[p][0]>>cd[p][1];
i = 0; j = i + 1;
dist = (2 * std::acos(-1.0) * R); while(i < N) { dist += std::sqrt( ( (cd[j][0] - cd[i][0]) * (cd[j][0] - cd[i][0]) ) + ( (cd[j][1] - cd[i][1]) * (cd[j][1] - cd[i][1]) ) ); i++; j = (i + 1) % N; }
std::cout <<std::setprecision(2) << std::fixed <<dist; return 0; } |
Correct answer? | szczepi | 2105. Alice and Bob are on Bikes | 8 Dec 2016 19:27 | 2 |
What answer should be for given test? 1 1 1 1 0 |
Sample explanation | Foobar | 1781. Clean Code | 8 Dec 2016 15:29 | 4 |
Can anyone explain the sample: 3 0 0 0 1 1 0 1 1 0
1 1 3 I dont understand it. The resulting matrix is: 0 1 1 0 1 1 0 0 0 Thanks! I think the correct final matrix must have all 1(s) above or lie on the main diagonal. Any hint to solve this problem ? Edit: nvm, solved it, nice problem with simple algorithm :D Edited by author 12.10.2010 11:07 Edited by author 12.10.2010 11:07 This problem very similar with 1042- central heating Each move (i,j) make switching (and replacing) of some set of pairs of cells. Thus we have linear system over field {0,1) No, the solution is much simplier. You just need to investigate the properties such an operation has. Edited by author 08.12.2016 15:31 |
Use 'Visual C++ 2013' instead of 'G++ 4.9 C++11' | [SESC]Fstilus ♂♊🎧皇 | 1198. Jobbery | 7 Dec 2016 21:29 | 1 |
Same solution: Visual C++ 2013: Accepted 0.686 8 120 КБ G++ 4.9 C++11: Time limit exceeded 21 1.513 3 924 КБ oh my code.. |
I have some thought on this problem: | Shen Yang | 1399. Economical Director | 7 Dec 2016 14:25 | 1 |
first use dynamic programming to find the minimum value of distance from 0 and visit 1~m once then to 0, we can get a chain 0--i1-i2--...-im--0 then we consider to cut this chain, use dynameic programming dp[i] to record distance.we cut first i node of the chain.. dp[m] is the result.. I'll try this idea... |
C++ ac,G++ TLE | Shen Yang | 1626. Interfering Segment | 7 Dec 2016 12:26 | 3 |
judgement is not stable,sometimes submit AC sometimes submit TLE... 800*800*400 random can AC |
what is test number 2? | tantai1993 | 1086. Cryptography | 7 Dec 2016 10:04 | 2 |
can someone explain test number 2? |