Common BoardTried several times with different variations of input processing. Can you please give me some hints? Here is my code: http://pastebin.com/beh0mtGhFor n = 7 We can solve it only with circle of radius 3. However, we send the solution, which prints more than 3. Link to the picture - https://www.dropbox.com/s/s2hqzmyo47la0zd/Clar.pngPlease, correct the tests, or provide the reason this solution is wrong. Have you READ the problem before submitting it? Statement is more than clear: "At first you want to draw a circle and place all your bottles inside it so that *each* of the bottle bottoms *touches* the circle" I fully agree with you, with 7 and 6 bottles the answer should be 3 and my program give me more than 3 for 7 bottles but the judge accept it, that's wrong or why not? Oh yea! I also solved a circle packing problem at the beginning :) But the problem is much more easier. This cost me a lot of contest time... Edited by author 29.10.2013 00:21 New tests have been added. 13 authors have lost AC after rejudge. Edited by author 05.08.2013 10:00 This test helped me to get AC, though I think it's good only against my solution: 3 4 1 100 1000 0 1 1 1000 0 100 0 1000 100 //answer 1 1 2 2 it helps me a lot! appreciate you in chinese :谢谢你 The fee is a POSITIVE integer. i use the greedy,but wa on #5! the faq say "use %lld to output the long long" but it's should be %I64d.. F**K waste my two days. the server use windows instand of linux??? Edited by author 29.10.2013 13:14 Hello everybody! System said: "wrong answer" Here is code: a = str(input()).split('\n') x = 0 while x < len(a): a[x] = a[x].capitalize() x += 1 print('\n'.join(a)) 1. *deleted* 2. It's possible for the input file size to exceed 6 MB. In C++, reading it from cin is out of the question, and scanf() is apparently slow too. getchar() is faster. Edited by author 27.10.2013 14:02 Your test is incorrect, "If a clone learn (not relearn) a program, all cancellation record history of this clone is deleted". So we can't do "relearn" in last line. First test is test from statment, and it is correct Your first solution has a bug, so it falls with runtime Oh, found it. Using a buffer of 8 chars to read the command's name was a terrible idea (one more is needed for '\0'), but it worked fine on my local machine. Is there a way to track such access violations locally? Deleted the first "hint" to avoid causing confusion. I got AC (Problem 1123, 24.04.2013), but after new tests added - rejudged and WA15. Old version: 2433 --> 2552 24332552 --> 24344342 New version: 2433 --> 2442 24332552 --> 24333342 0 --> 0 9 --> 9 10 --> 11 100003 --> 101101 10003 --> 10101 150006203700 --> 150006600051 1500329999 --> 1500330051 My program returned correct answer for all forum's tests and my tests. But now, I got WA7! Help me, please. (Real test #7) Edited by author 27.10.2013 03:30 Edited by author 27.10.2013 03:33 Edited by author 27.10.2013 03:34 I got AC (Problem 1123, 24.04.2013), but after new tests added - rejudged and WA15. Old version: 2433 --> 2552 24332552 --> 24344342 New version: 2433 --> 2442 24332552 --> 24333342 0 --> 0 9 --> 9 10 --> 11 100003 --> 101101 10003 --> 10101 150006203700 --> 150006600051 1500329999 --> 1500330051 My program returned correct answer for all forum's tests and my tests. But now, I got WA7! Help me, please. (Real test #7) Edited by author 27.10.2013 03:45 #include <iostream> using namespace std; int main() { int i, j, k = 0, n, m, stud; scanf("%d", &n); int *prepod = new int[n]; for (i = 1; i<=n; i++) { scanf("%d", &prepod[i]); if (i>=2) { if (prepod[i] == prepod[i-1]) prepod[i-1] = -1; } } scanf("%d", &m); for (i = 1; i<=m; i++) { scanf("%d", &stud); for (j=1; j<=n; j++) { if (stud == prepod[j]) k++; }
} printf("%d", k); return 0; } Edited by author 20.10.2013 06:07 Edited by author 20.10.2013 06:08 Edited by author 20.10.2013 06:08 #include <iostream> using namespace std; int main() { int i, j, k = 0, n, m, stud, first = 0, last, temp = 0; scanf("%d", &n); int *prepod = new int[n]; for (i = 1; i<=n; i++) { scanf("%d", &last); if (first != last) { first = last; temp++; prepod[temp] = last; } } scanf("%d", &m); for (i = 1; i<=m; i++) { scanf("%d", &stud); for (j=1; j<=temp; j++) { if (stud == prepod[j]) { k++; break; } }
} printf("%d", k); system("pause"); return 0; } Is it correct? almost linear algo gets TL! ID: 5285869, line: 108: what happens if statment under "if" will be true? :) Sh..t, thanks, added 2 lines and AC =( +1 to stupid mistakes that spoiled the whole contest =( BTW, the contest was cool, thanks! Edited by author 27.10.2013 01:41 Edited by author 27.10.2013 00:36 Let's say my team participated in some Timus contest and tasks of this contest went into the main problem set. And now I'd like to submit problems (that were solved by Me) under my login. Is it OK for two logins (mine and my team) to have the identical submissions? What if I'd like to submit the code of my teammates? And if both questions have "it's OK" answer where is this thin boundary that delimits "OK" and "not OK"? Edited by author 26.10.2013 18:44 Edited by author 26.10.2013 18:45 In our team was are rule: if you write some code, you can submit it under your own login (but there was no accounts on Timus with this code, becouse it was writed on onsite). I think it's OK to resubmit your own solution. I've started learning C++ two weeks ago. And I can't read all the line with spaces. I include <istream>, but can't use "getline". Visual studio 2012 express. can anybody tell me what is test 4 with 0 and not with 1=))) If K > N - K, how can every spy kill exactly one non-spy? Are all the time-stamps recorded by the sensor guaranteed to be unique? I think this is implied by the fact that they are "increasing" (rather than "non-decreasing") but wanted to check. #include <iostream> using namespace std; unsigned __int64 c(unsigned __int64, unsigned __int64);
unsigned __int64 a,b,n,ans; int main() { cin >> n >> a >> b; ans=c(n+a,a)*c(n+b,b); cout << ans; return 0; } unsigned __int64 c(unsigned __int64 l, unsigned __int64 k) { unsigned __int64 i,r=1,d=l-k; for (i=1;i<=d;i++) {r*=(i+k); r/=i;} return r; }
Edited by author 24.06.2004 19:00 There is another formula but if I write it I don't think it will really help you... Why do you think so? Interestingly N 1 1 = (n+1)^2 and 1 a b when a=b answer (a+1)^2; 5 1 1 = true answer 36 and 1 5 5 = 36 etc ^_^ Edited by author 26.07.2010 02:34 Edited by author 26.07.2010 02:34 because the answer = (how many ways you can put no more than A red balls into N boxes)*(how many ways you can put no more than B blue balls into N boxes) and (how many ways you can put no more than A red balls into N boxes)=C(a+n,a)//it is like there are a+n stickes in order, and you pick up n sticks so the rest sticks are divided into n+1 parts,the last part is for the balls which is not put in the box,and the 1st to nth part is for box 1st to nth and the same for (how many ways you can put no more than B blue balls into N boxes) This problem has a much easier(to understand) dp solution. |
|