Show all threads Hide all threads Show all messages Hide all messages |
WA#13 | kxurshid | 1402. Cocktails | 22 Jun 2013 17:14 | 6 |
WA#13 kxurshid 19 Sep 2009 01:43 My code: #include <iostream> using namespace std; double fac(int n) { double l = 1.0; for(int i = 1; i <= n; i++) l *=i; return l; } double A(int m, int n) { return fac(m)/fac(m-n); } void main() { int n; double soni = 0; cin >> n;
for(int i = 2; i<=n; i++) { soni += A(n,i); }
cout.precision(0); cout << fixed << soni; } WA#13 Where is my mistake? pls help me i have met the same problem with u Precision Edited by author 28.01.2012 00:07 Edited by author 28.01.2012 00:07 primer 21=138879579704209680000 19=330665665962403980 20=6613313319248079980 0-1 2-2 3-12 4-60 5-320 6-1950 7-13692 8-109592 9-986400 10-9864090 11-108505100 12-1302061332 13-16926797472 14-236975164790 15-3554627472060 16-56874039553200 17-966858672404672 18-17403456103284402 19-330665665962403980 20-6613313319248079980 21-138879579704209680000 |
Test 19 | aaa | 1402. Cocktails | 22 Jun 2013 17:11 | 3 |
What is the right answer in test 19 ? |
Может ли Вова разворачиваться возле статуй? | Uran | 1966. Cycling Roads | 22 Jun 2013 15:25 | 2 |
Edited by author 22.06.2013 15:11 |
easy for the Java coders | Konstantin Yovkov | 1243. Divorce of the Seven Dwarfs | 22 Jun 2013 14:47 | 2 |
If you use BigInteger the program is e-a-s-y :) Got AC from the first try :) Not only Java, but Python and Ruby as well. |
B (when i>m)is not required according to a fixed position to sit? | hnust_liuwenjing | 1962. In Chinese Restaurant | 22 Jun 2013 14:03 | 1 |
Edited by author 22.06.2013 14:08 |
Don't understand the problem | Prime | 1287. Mars Canals | 22 Jun 2013 09:22 | 3 |
can someone please explain the problem, specially the part "(parallel to the north-south or east-west directions or at the angle 45° to them)" and the first sample input-output. At last I have understood the problem (thanks to Fahim and Sadia). You have to consider either north-south, or east-west or diagonal straight lines; consider which yields highest amount of crop of a kind instead of all of them together. More clearly, for first test, SsS sSs SsS my confusion was _s_ s_s _s_ we can get a ring of 4 's' ... so the ans should be s 4 but later my friends explained consider only one straight line,which ever produces most as S__ _S_ __S or _s_ s__ ___ or ___ __s _s_ Hope my problem helps other. |
Runtime error (access violation) and I don't know why? | kaa..........ai | 1086. Cryptography | 21 Jun 2013 21:39 | 2 |
Here's my code: #include<iostream> using namespace std; int pri[20000],pr[4040000]; void p() { memset(pr,0,sizeof(pr)); int i,j; for(i=2;i<=1500;i++) for(j=i*i;j<4000000;j+=i)pr[j]=1; int kk=1; for(i=2;i<=4000000;i++) if(pr[i]==0)pri[kk++]=i; } int main() { int n,t; p(); while(scanf("%d",&n)!=-1) { while(n--) { scanf("%d",&t); printf("%d\n",pri[t]); } } return 0; } What's wrong with it?Who can help me? Edited by author 21.06.2013 21:02 Cheer up! Solved! Here's my code:(一个合适的范围是看来是很必要的啊!) #include<iostream> using namespace std; int pri[20000]; int pr[204000]; void p() { int i,j; for(i=0;i<=200000;i++)pr[i]=1; for(i=2;i<=447;i++) for(j=i*i;j<200000;j+=i)pr[j]=0; int kk=1; for(i=2;i<=200000&&kk<=15010;i++) if(pr[i])pri[kk++]=i; } int main() { int n,t; p(); while(scanf("%d",&n)!=-1) { while(n--) { scanf("%d",&t); printf("%d\n",pri[t]); } } return 0; } |
If you have WA 4 | Alexey Dergunov [Samara SAU] | 1959. GOV-internship 3 | 21 Jun 2013 21:26 | 1 |
There are no zeroes in this test. |
You use BigIntegers or strings | Adhambek | 1206. Sum of Digits of the Sum of Numbers | 21 Jun 2013 21:05 | 1 |
because , input: n = 50 Length of output is 87 digits output : 682455418022864824778975492858747729001539122984270520078098343219608068466186523437500
Edited by author 21.06.2013 21:07 |
WA #5 | igloo | 1891. Language Ocean | 21 Jun 2013 02:08 | 1 |
WA #5 igloo 21 Jun 2013 02:08 In one line more then one error. 1 ReadInt2() : int ReadInt(int) : int 2 int x = ReadInt2() int x = ReadInt(y) |
To admins : two possible answers | sylap | 1303. Minimal Coverage | 21 Jun 2013 00:56 | 1 |
For Input : 10 -5 1 1 14 -5 2 2 3 3 19 0 0 Output1 : 2 -5 1 1 14 Output2 : 2 -5 2 1 14 Are both output1 and output2 considered as correct ? EDIT At least output2 is considered as CORRECT. (Finally solved :D) Edited by author 21.08.2013 18:18 |
Oh,I got TLE | Accepted | 1846. GCD 2010 | 20 Jun 2013 19:12 | 3 |
I have tests many tests,with which I have found my program's mistakes,and maybe this tests can help you: 4 + 2 + 309 - 2 + 957 and the answer is: 2 1 309 3 but I got TLE at #18 now... Now I got TLE on #29 The mistake my program have is when I have done the discretization,I'll check a array whose length is n to refresh the order,then if we set o is the number after refreshing,we should set the ioop variables i=o rather than o=i... Now I got TLE on #29 The mistake my program have is that when I have done the discretization,I'll check a array whose length is n to refresh the order,then if we set o is the number after refreshing,we should set the loop variables i=o rather than o=i... |
WA 6 ? | bayram | 1752. Tree 2 | 20 Jun 2013 18:49 | 1 |
WA 6 ? bayram 20 Jun 2013 18:49 |
Why this answer is not correct???? | Opportunity | 1176. Hyperchannels | 20 Jun 2013 13:11 | 1 |
Input 4 2 0 0 1 0 0 0 1 0 1 1 0 1 0 0 1 0 Output 2 1 1 4 4 1 1 2 2 4 4 2 |
5-testga xato qilganlar uchun 2 ta example | Adhambek | 1067. Disk Tree | 20 Jun 2013 12:53 | 2 |
only Uzbek from ADHAM!!! input: 4 TUT\TUT\TUT\TUT\TUT\TUT\TUT TUT\TUT\BUT\BUT\BUT BUT\TUT\TUT\TUT\TUT YUT\YUT\BUT\TUT\YUT output: BUT TUT TUT TUT TUT TUT TUT BUT BUT BUT TUT TUT TUT TUT TUT YUT YUT BUT TUT YUT input: 4 A\A\A\A\A\A\A A\A\A\A\B\B\B\B A\A\A\A\C\C\C\CB\B\B\V A\A\A\A\B\C\C\C\C\C\C output:
A A A A A A A B B B B C C C C C C C C C CB B B V Edited by author 19.06.2013 20:29 |
Is there any special tests??? | Accepted | 1846. GCD 2010 | 20 Jun 2013 12:51 | 2 |
I have debug my program for two days,but I still cannot find any mistakes in my program. I wrote a program in order to make random tests,and I have used the accepted program to get the right answer and compare it to my program's answer.The result is right.... Edited by author 20.06.2013 11:01 |
To Admins. Weak hashing tests. | d3m0n1c | 1700. Awakening | 19 Jun 2013 19:17 | 1 |
Words can be easily hashed like: int hash = 0; while(..){ hash = hash * 31 + 'readed byte' } So equals will looks like: @Override public boolean equals(Object o) { return this.hash == o.hashCode(); } |
why WA9? | JavaTopCoder | 1183. Brackets Sequence | 19 Jun 2013 01:03 | 4 |
Did anybody get WA on test 9? May be, it's judge error? what answer? my program outputs ()()(()) Input : [()]](]) Output [()[]]([]) |
WA at test case 2 | sanjeevp | 1956. Fire Signals | 18 Jun 2013 17:03 | 1 |
Unable to figure out what could be test case 2. Can any one please help. |
So why n^3 algo can finish in 0.078s? | tiancaihb | 1167. Bicolored Horses | 18 Jun 2013 13:47 | 3 |
My state is f(n,k) so it's obviously a n^3 algo. And the code is very short. But it works fast... Why? Bceause you can do almost 100*10^8 operations in 1 sec :) Are you sure ? 10 milliards ? or 100 millions ? |