| Show all threads Hide all threads Show all messages Hide all messages |
| WA7, help please | Incognito | 1553. Caves and Tunnels | 5 Jul 2020 01:59 | 1 |
|
| okay did it! =) | kswati.arcturus@gmail.com | 1149. Sinus Dances | 4 Jul 2020 20:39 | 1 |
#include<bits/stdc++.h> using namespace std; void prin ( int i) { int j; for ( j =1 ; j <= i ;j++) { cout << "sin(" << j; if ( j == i){ for (j = 0 ; j<i ; j ++) cout <<")"; break;} else { if (j%2) cout << "-"; else cout << "+"; } } } int main() { int i,j,n; cin >> n; int k = n; for (i = 1; i < n ;i++) cout << "("; for ( i = 1 ; i <= n ; i++,k--) { prin(i); if (i!= n) cout << "+"<<k<<")"; } cout << "+1\n"; return 0; } |
| Do not forget that (10^7)^2 > 2^31 - 1. Use long long, if you square some numbers. | KostyaRychkov | 2032. Conspiracy Theory and Rebranding | 4 Jul 2020 08:26 | 1 |
I spent two hours finding this stupid mistake. Do not be like me, do everything with a margin. |
| Useful tests | Yury_Semenov | 2147. City Building | 3 Jul 2020 22:37 | 1 |
4 4 2 3 1 2 1 3 2 4 3 4 ans: 6 12 16 2 30 1 2 2 3 3 1 4 5 5 6 6 4 7 8 8 9 9 7 10 11 11 12 12 10 1 4 1 7 4 10 7 10 ans: 24 6 8 2 30 1 2 2 3 3 1 4 5 5 6 6 4 1 4 2 4 ans: 12 |
| Weak test case | zigzog | 2034. Caravans | 3 Jul 2020 20:12 | 1 |
I 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 |
| Test for WA6 | Yury_Semenov | 2119. Tree Hull | 3 Jul 2020 17:43 | 1 |
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 |
| WA 6 | Virus TI | 1599. Winding Number | 3 Jul 2020 14:54 | 2 |
WA 6 Virus TI 27 Jun 2020 23:08 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 |
| WA2: "Impossible." with a dot | KostyaRychkov | 1294. Mars Satellites | 3 Jul 2020 03:16 | 1 |
If it is impossible to find out the distance from C to D, then write "Impossible." and not "Impossible" |
| What's the meaning of this problem? | RoBa @ TJU | 1409. Two Gangsters | 3 Jul 2020 00:57 | 13 |
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 |
| ADMINS! test #4 WA, but it's right algorithm | Alexander Prudaev | 1403. Courier | 2 Jul 2020 01:16 | 26 |
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 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????? 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?? |
| If you have WA3(C++) | Vikono | 1283. Dwarf | 2 Jul 2020 00:41 | 1 |
Just use double type instead int |
| Crash #3 | watashi | 1846. GCD 2010 | 1 Jul 2020 23:30 | 2 |
it is possible that the collection be empty after some operations! gcd(empty set)=1. Edited by author 31.03.2012 15:04 Thanks! KostyaRychkov 1 Jul 2020 23:30 Thanks! I'm too get WA3, because didn't notice it |
| Problems I have encountered before getting accepted | Catsae | 2111. Plato | 1 Jul 2020 00:45 | 2 |
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. |
| WA31 | UstinovG`~ | 1793. Tray 2 | 30 Jun 2020 13:30 | 1 |
WA31 UstinovG`~ 30 Jun 2020 13:30 Check the way how you find the upper radius if h>d. |
| whats wrong? c++ | sultz8 | 1001. Reverse Root | 28 Jun 2020 22:18 | 1 |
#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; } |
| help me please #14 | MassterMax🤔`~ | 1244. Gentlemen | 28 Jun 2020 15:33 | 3 |
All forum tests passed, but wa:( Million thanks to someone who will help! upd: I have AC with this test: 0 2 1 1 |
| Need hint pbsd | Rafid | 1028. Stars | 28 Jun 2020 14:43 | 1 |
Can someone tell me how I can solve thi problem using ordered set? |
| i have WA 1. Could someone tell me the first test? | Ivan | 1963. Kite | 27 Jun 2020 22:02 | 1 |
|
| wa 36 | Alexbububu | 2115. The Knowledge Day | 27 Jun 2020 14:22 | 1 |
wa 36 Alexbububu 27 Jun 2020 14:22 What is test №36? I don't understand why my programm crash on test. |
| Перебор? | Krayev Alexey | 2061. OEIS A216264 | 27 Jun 2020 01:30 | 2 |
Перебор? Krayev Alexey 22 Nov 2015 16:44 Т.е. у этой задачи предполагается написание перебора с отсечениями? Последовательно добавляем символы в конец строки и если не смогли найти палиндрома, который бы являлся суффиксом новой строки, то дальше не перебираем? |