| Show all threads Hide all threads Show all messages Hide all messages |
| Помогите с 6 тестом... | Nakatengga | 1971. Graphics Settings | 8 Sep 2013 18:43 | 2 |
Совсем не могу понять почему не проходит 6 тест, проблема у меня не 59,9 как было у другого задовавшего вопрос... lual.ru Edited by author 08.09.2013 18:45 |
| WA 1 help!!! | Alexandr-pro | 1209. 1, 10, 100, 1000... | 7 Sep 2013 18:27 | 1 |
#include <stdio.h> #define c 65535 int main() { long long k = 0; long long a[c]; long n = 0,i,ot[c],j,t;
a[0]=1; for (i=1; i<=c; i++) { a[i]=a[i-1]+i; } scanf("%ld",&n); for (i=0; i<n; i++) { scanf("%lld",&k); for (j=0; j<c; j++) { t=0; if (a[j]==k) { t=1; break; } } ot[i]=t;
} for (i=0; i<n; i++) { printf("%ld ",ot[i]); } return 0;
} |
| If you WA #9, check if point A ≡ (coincides with) point B | Iliyan | 1075. Thread in a Space | 6 Sep 2013 22:08 | 1 |
That's how I get AC after so much time. Edited by author 06.09.2013 22:11 |
| Fast solution | Alexey Prokopnev | 1872. Spacious Office | 6 Sep 2013 11:55 | 4 |
For solving this problem I used advanced bipartite graph theory. But it work slowly(about 0.6sec). Very interesting how solve more quickly. Please, give me some hints.(My e-mail: scarlet.flower@list.ru) Maximum matchings in bipartite graph is almost enough to solve it + some "magic" :) Maybe maximum flow algos' works better here... My complexity was O(V*E), 0.3sec Also, O(NlogN) solution exists |
| 2 ADMINS: timus C# megacompiler, weak tests or bug in checker??? | Vedernikoff 'Goryinyich' Sergey (HSE: АОП) | 1953. Biggest Inscribed Ellipse | 4 Sep 2013 19:47 | 2 |
On my VS 2012 C# compiler on test 1000 1000 1000 my program's output is 0.0000143861 288.6751345948 which doesn't seem to fit into precision (from the solution correctness criteria). But AC on timus under VS 2010 C# compiler. Just interesting: there is no such test, timus VS 2010 is better than my VS 2012, or checker checks not equality of both numbers in output and answer, but some more weird thing? There was incorrect checker, it checked with precision 10^-4. It fixed now, all solutions were rejudged, 7 authors lost their AC. |
| What is test #19? | Artyom -178 RUS- | 1510. Order | 4 Sep 2013 12:22 | 1 |
|
| Counter example for 3D convex hull algorithm | [MF] Radomir Djokovic | 1062. Triathlon | 4 Sep 2013 04:34 | 3 |
I think I found counter example for this, ie. set of points of which one is inside the 3D convex hull, but it's appropriate contenstant can win. If we are given for contestant with following speeds: 1 1 2 1 1 4 100 1 3 1 100 3 20 20 3 If we choose paths of length 100, 100, 3, than last contestant (20, 20, 3) can win with time 100/20 + 100/20 + 3/3 = 11. But, for this points 3D convex hull consists of (1, 1, 2), (1, 1, 4), (100, 1, 3) and (1, 100, 3). Does anyone know if I'm wrong and why? Consider that the sum of swim,bike and run is a const number,so we can let the total s=1,then we can solve it for 2D convex hull alogrithm rather than 3D. You should use reciprocals of speeds (preferably multiplied by some constant) as coordinates, but not just the speeds. After applying such an "inversion" to the points in your example, the last one jumps out of the convex hull formed by others. |
| wa 7 | Mikron | 1283. Dwarf | 4 Sep 2013 01:11 | 2 |
wa 7 Mikron 12 Jul 2013 19:08 why wa #7 please help( #include <stdio.h> int main(void) { int s; int p; float zo; int t = 0; scanf("%f",&zo); scanf("%d",&s); scanf("%d",&p); while(zo>s){ zo -= zo*p/100; ++t; } printf("%d",t);
return 0; } use float instead of int for s and you will get AC |
| why wa on test 8 | tyomitch | 1552. Brainfuck | 3 Sep 2013 22:27 | 2 |
It's the first test where more than one memory cell needs to be modified. Do I miss something in the problem statement? E.g. is this test correct? azkazkazkazkazkazkazoazv ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++.+++++++++++++++++++++++++.<+++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.>>+++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++.<.<.>>.<.<.>>.<.<.>>.<.<.>>.<.<.>>.<.<++++.>>.<.----. Try this test: azqhazqhazqhazqhazqhazqhazqhazqhazqhazqhazqhazqh My answer: +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.+++++++++++++++++++++++++.<+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.<++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.<+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.>>>.<.<.<.>>>.<.<.<.>>>.<.<.<.>>>.<.<.<.>>>.<.<.<.>>>.<.<.<.>>>.<.<.<.>>>.<.<.<.>>>.<.<.<.>>>.<.<.<.>>>.<.<. |
| Hint! | IgorKoval [PskovSU] | 1472. Martian Army | 3 Sep 2013 01:55 | 1 |
Hint! IgorKoval [PskovSU] 3 Sep 2013 01:55 Observe than A[i] must be equal 0 or 1 ( no double ). Just compute dp[v]. dp[v] is cost of traffic of subTree with root v if A[v] = 1. If A[v]=0 than cost(of traffic of subTree with root v) equals zero. Edited by author 03.09.2013 01:58 Edited by author 03.09.2013 01:59 |
| WA# 12 | IgorKoval [PskovSU] | 1962. In Chinese Restaurant | 2 Sep 2013 03:44 | 1 |
WA# 12 IgorKoval [PskovSU] 2 Sep 2013 03:44 Test: 2 1 2 answer: 1 Maybe your answer is 2? =) Edited by author 02.09.2013 03:44 Edited by author 02.09.2013 03:46 |
| test 30 | Alex | 1820. Ural Steaks | 1 Sep 2013 23:49 | 1 |
My solution failed in test 30. How I can find what is wrong? Help me please Edited by author 01.09.2013 23:49 |
| WA#3 ? | Evgeniy | 1414. Astronomical Database | 31 Aug 2013 22:21 | 3 |
WA#3 ? Evgeniy 30 Aug 2011 04:55 Give me please 3 (third) test. I've tested with other tests from this forum - all works fine, but I have WA#3 problem... I rewrote my solution - got time limit on 10th test - good, but I think it's may be bug (or feature?) in 3 test (because i changed only 1 feature in input/output code). Can anyone give me this (3) test? Edited by author 30.08.2011 06:23 Edited by author 30.08.2011 06:26 Re: WA#3 ? Anton Chaplygin [Kungur][USU] 31 Aug 2013 22:21 |
| Correct idea is HERE | A new start... | 1051. Simple Game on a Grid | 31 Aug 2013 20:06 | 7 |
I will show you only two combinations("x" means stone, that was killed at last lead). 1). Those you can kill three stones oo xo oo ox oo oo ox o oo oo o o 2). Those you can kill six stones o oo ox o oooo ooox oox oo oo ox o oooo ooo oo oo xo oo ox This are all you need to get AC. (But I cannot prove that if (M Mod 3 = 0) or (N Mod 3 = 0) answer is 2, I can only show how make it) P.S. Sorry for bad English. BTW, you also need that if you have only one row or column, you can only take half of the stones Interesting. But I also can't proove it! How to get this idea more formally? Let's talk about this. Thank you if n or m is divided by 3 we can prove that we can leave only 3x3 stones. and than its easy to finish game with 2 stones. assume that m is divided by 3.so we can divide rectangle into m/3 parts and reduce each's "n" to 3. than reduce m to 3 and we'll get cube with dimensions 3x3. Edited by author 16.04.2007 22:24 I still can't get it,especially for your graph,I hope you can explain it more clear. Thanks. Here comes the proof of why you can't remove all stones but one if M or N is divisible by 3. Let us paint all the grid nodes for which the sum of their coordinates is divisible by 3 ((x + y) mod 3 = 0) in red, all ones meeting the (x + y) mod 3 = 1 condition in green, and the rest in blue. Let us also denote the amount of stones placed in red, green and blue nodes as R, G and B respectively. Obviously, each turn two stones lying on nodes of different colors turn into one stone lying on the third color. So, two of the R, G and B values get decreased by 1, and the third one gets increased by 1. This process has an invariant: parities of (R - G), (R - B) and (G - B) don't change! At the start of the game with M or N being divisible by 3 R, G and B are equal. So all the three differences listed above stay even till the very end, and it's impossible to get the (1,0,0), (0,1,0) and (0,0,1) combinations of R,G,B, therefore the game can't be finished with only one stone. Q.E.D. P.S. My English could have some flaws, i know. |
| compile error | NaNyan | 1654. Cipher Message | 31 Aug 2013 06:14 | 1 |
#include<stdio.h> #include<algorithm> #include<list> using namespace std; int main(){ char str[200000]; cin>>str; bool litter[26]; for(int i=0;i<26;i++) { litter[i]=false; } for(int i=0;i<strlen(str);i++) { litter[str[i]-'a']=!litter[str[i]-'a']; } list<char> clist; for(int i=0;i<strlen(str);i++) { if(litter[str[i]-'a']) { litter[str[i]-'a']=false; clist.push_back(str[i]); } } copy(clist.begin(),clist.end(),ostream_iterator<char>(cout)); return 0; } it do works on my own machine, How? |
| Test 1 is wrong!!!!!!!!!! | OIer_cjf | 1003. Parity | 30 Aug 2013 19:49 | 2 |
In some way,I got test1. In the about 570th line,there is a mark"'".I don't know what is it for.I think it is by mistake. It is same with some large test points. Edited by author 05.04.2009 22:14 I have nothing to say about the Text 1... I Wa this point for ... about 1 hour |
| Why does my solution isn't right even on sample test? | Iliyan | 1075. Thread in a Space | 30 Aug 2013 00:11 | 6 |
#include<iostream> #include<stdio.h> #include<math.h> using namespace std; struct point { double x; double y; double z; }; double pi=3.14159265358979323846; int main () { point a,b,c; double tanga,tangb,distac,distbc,ang,arc,r,angpt; cin >> a.x >> a.y >> a.z >> b.x >> b.y >> b.z >> c.x >> c.y >> c.z >> r ; distac=sqrt((a.x-c.x)*(a.x-c.x)+(a.y-c.y)*(a.y-c.y)+(a.z-c.z)*(a.z-c.z)); distbc=sqrt((b.x-c.x)*(b.x-c.x)+(b.y-c.y)*(b.y-c.y)+(b.z-c.z)*(b.z-c.z)); tanga=sqrt(distac*distac-r*r); tangb=sqrt(distbc*distbc-r*r); angpt=acos(((a.x-c.x)*(b.x-c.x)+(a.y-c.y)*(b.y-c.y)+(a.z-c.z)*(b.z-c.z))/ (sqrt((a.x-c.x)*(a.x-c.x)+(a.y-c.y)*(a.y-c.y)+(a.z-c.z)*(a.z-c.z))* sqrt((b.x-c.x)*(b.x-c.x)+(b.y-c.y)*(b.y-c.y)+(b.z-c.z)*(b.z-c.z))))*(180/pi); //angle between the two vectors AC and BC ang=angpt-(((atan2(tanga,distac)+atan2(tangb,distbc))*(180/pi))); ang/=360; arc=ang*2*pi*r; printf("%.2lf",tanga+tangb+arc); cout << endl ; return 0; } I know that I have to check if there could be a straight line but I think that the sample test should be right for my program. My program writes 19.78 not 19.71. Thanks in advance. Should be ang=angpt-(((asin(tanga/distac)+asin(tangb/distbc))*(180/pi))); Also, why don't you get rid of these annoying 180/pi, /=360? Try to calculate in radians. Edited by author 31.07.2013 03:04 Edited by author 31.07.2013 03:07 Help I have WA8. Then I multiplied the whole data with 500 and divide the output with 500 and then I have WA9. Why does printf doesn't work? Edited by author 31.07.2013 21:12 I really have no idea. Again, try to get rid of redundant * and / — they can cause error via rounding (though I don't believe these roundings are so influential). If not, try maybe to play with different ways of calculating some values in triangles (sin or cos or tan). Btw, problem 1042 is much more interesting for me. You solved it, good job. Thanks but you solved this problem so and for you good job. I found out that when you use printf for long long int you should write printf("%ld...); not lld and for double you should write printf("f....); not lf. I'll be glad if this will help someone. |
| advise | D05T0N | 1149. Sinus Dances | 29 Aug 2013 22:35 | 1 |
advise D05T0N 29 Aug 2013 22:35 You need use function one cycle,one function and Accepted |
| TO ADMINS! Please add this test. | Plamen_N | 1247. Check a Sequence | 29 Aug 2013 19:52 | 2 |
30000 30000 0 | 0 | . | => 30000 lines with '0' on each . | 0 | There are solutions that may get Time Limit. The sum of all elements of the sequence must be equal to S + N (60000). Your test is incorrect. |
| 45-ый тест | kostan3 | 1938. Caribbean Triangle | 29 Aug 2013 14:33 | 1 |
|