Common BoardI checked two accepted solution But They are giving different output in same test case. AC code 1: https://paste.ubuntu.com/p/RwtFH2s4xK/AC code 2: https://paste.ubuntu.com/p/vmrXrdcJN6/ Tese case : 25 28 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 11 12 12 13 13 14 14 15 15 16 16 17 17 18 18 1 5 19 19 20 20 21 21 22 22 23 23 24 24 25 25 14 15 22 6 22 1 10 21 Output in code 1 : 2 Output in code 2 : 3 Answer should be : 2 5 1 2 1 2 3 1 3 4 1 4 5 1 7 + 1 + 3 + 5 - 3 + 4 - 1 - 5 ans: 0 2 4 4 4 1 0 I can't figure out where my mistake is. Can someone give me some tests? facttacf@gmail.com он поможет. Edited by author 03.07.2020 14:55 If it is impossible to find out the distance from C to D, then write "Impossible." and not "Impossible" Seems an easy problem, but I can't understand it... 4 7 - input data 1 - common can (4+7)-1=10 - amount of cans How can you get "1-common can"? Or the problem says there must be one common can? At some moment it happened so that they shot the same can - last can Still a little puzzled... Anyway I have got AC, thx for your help :) why I am wrong on test2,it seems very easy "The 12th High School Pupils Collegiate Programming Contest of the Sverdlovsk Region (October 15, 2005)" What a mockery ?!?! cin >> h >> l; cout << l-1 << " " << h-1; And that's all ... (0.001 sec and 220Kb memory used :) ) P.S. 137Kb if it's transformed for C Edited by author 06.10.2006 00:10 if 2 3 - imput data 1 common can (2+3)-1=4 - amount of cans readln(n,m); writeln(m-1,' ',n-1); I can explain it easily. 1 1 1 1 "1" 1 1 1 1 1 1 1 the quoted 1 is the can which they will shot it at the same time. hope i helped after 4 years :D Yes it has helped me after 9 more year Edited by author 03.07.2020 00:58 test it your self after deleting this code, please explain me why WA twoalias[animal]inbox[youknow]ru #include <stdio.h> #include <memory.h> struct elt { int c; short i; }; elt T[100001]; int main() { memset(T,0,sizeof(T)); int N; scanf("%i",&N); short i; for (i=1;i<=N;i++) { int S,C; scanf("%i %i",&S,&C); if (C>T[S].c) { T[S].c=C; T[S].i=i; } } int j,ch=0; for (j=0;j<100001;j++) if (T[j].c>0) ch++; printf("%i\n",ch); for (j=0;j<100001;j++) if (T[j].c>0) printf("%i ",T[j].i); return 0; } Edited by author 29.08.2006 20:03 I think you didn't understand the task right! On the test 6 1 10 1 12 2 14 2 23 5 17 5 18 your program gives the answer 3 2 4 6 and the right answer is 4 3 4 6 5 Edited by author 30.08.2006 00:13 but I think, right answer is 3 2 4 6 in your case 2-th (#4 (2, 23)) and 4-th (#5 (2, 17) orders is expired
if you right, then why you can't output 5 1 3 4 5 6 or 6 1 2 3 4 5 6 ? please explain me, i can't understand Write your e-mail and I'll explain this task for you!) Edited by author 29.08.2006 23:58 Edited by author 29.08.2006 23:59 twoalias[animal]inbox[youknow]ru and on Russian please. Edited by author 30.08.2006 09:16 I've sent the message to you! If you won't get it write here, please!) I have the same problem. I can't understand meaning of this problem. help me please!!! Write your mail! Edited by author 04.11.2006 17:53 gio-saghinadze@mail.ru now I have WA 9:( I used heap I've sent a message!) Can you explain it to all of us ? I think this test is very useful for understanding this task 6 1 10 1 12 2 14 2 23 5 17 5 18 Answer 4 3 4 6 5
I'm understand problem, but how using dp to solve task? I solved it without using DP!) I solved it without using DP!) How????? Post your mail i dont understand, how to write program even after advices, can you explain it to me? rpmain@tut.by Please, explain! Why the answer to this test is: 4 3 4 6 5 Come on! It's easy to understand it. For example this test 3 1 9 2 10 2 11 The answer is 2 2 3. I can explain it. The deliver time is not exactly one day. So the second container (in my example) could be given in the first day and in the second day. So if the deliver time is N, it means that container could be given in 1, 2 ,..., N day (in any day, but not in the Nth day exactly). Hope it's clear to understand. Thanks Edited by author 12.09.2007 15:22 That's a question to authors why they wrote it that way :) Delivery time usually means something strict - not earlier, not later. What they meant is time due or a deadline. 6 1 10 1 12 2 14 2 23 5 17 5 18 --------------------- result: 3 4 5 6, Is right answer? Why 3 4 6 5 ? The delivery time of 3 4 6 = 2 + 2 + 5 = 9 so the delivery time of 5 is expired ! It's right ? Why 3 4 6 5 ? The delivery time of 3 4 6 = 2 + 2 + 5 = 9 so the delivery time of 5 is expired ! It's right ? NO! 2, 2, 5 isn't a delivery time to client it max time to delivery so if you want deliver goods to client with time 2 you must go to him in first day or in second day and delvery take 1 day! 4 3 4 5 6 is this wrong answer?? Just use double type instead int it is possible that the collection be empty after some operations! gcd(empty set)=1. Edited by author 31.03.2012 15:04 Thanks! I'm too get WA3, because didn't notice it 1. If time limit exceeded, use a better sorting algorithm. In my case, insertion sort spent barely over a second, while merge sort spent only 0.6 of a second. 2. used long long. Also, before multiplying a long long and an int together, convert the int first. Sorting the input is a waste of time, quite frankly. Try some of your own inputs, the solution can be very simple & fast. Check the way how you find the upper radius if h>d. #include <iostream> #include <math.h> #include <vector> #include <stdlib.h> using namespace std; int main() { vector<double> v; int v1; while((cin>>v1)) { v.push_back(v1); } int size = v.size(); int first = v[0]; int last = v[size-1]; for(int i = size-1; i>=0; i--) { double a = sqrt(v[i]); printf("%.4lf\n", a); } return 0; } All forum tests passed, but wa:( Million thanks to someone who will help! upd: I have AC with this test: 0 2 1 1 Can someone tell me how I can solve thi problem using ordered set? What is test №36? I don't understand why my programm crash on test. Т.е. у этой задачи предполагается написание перебора с отсечениями? Последовательно добавляем символы в конец строки и если не смогли найти палиндрома, который бы являлся суффиксом новой строки, то дальше не перебираем? Hint: We must find pair for the first character or create it. If S[0] is ']' or ')', then we must add '[' or '(' in begin. If S[0] is '[' or '(', then we can find pair in S or add ']' or ')' after S[0]. Edited by author 26.06.2020 19:51 9 3 1 5 1 4 2 7 2 5 3 6 5 9 6 9 7 8 1 4 2 4 9 4 Answer: 8 (or 3) 3 8 |
|