| Show all threads Hide all threads Show all messages Hide all messages |
| 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 Т.е. у этой задачи предполагается написание перебора с отсечениями? Последовательно добавляем символы в конец строки и если не смогли найти палиндрома, который бы являлся суффиксом новой строки, то дальше не перебираем? |
| Python3: memory recurcion accepted 0.15 [Hint] | KostyaRychkov | 1183. Brackets Sequence | 26 Jun 2020 19:51 | 1 |
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 |
| WA 10 | kPeBeTkO_vs16 | 2141. Sasha Vilkin | 26 Jun 2020 16:05 | 3 |
WA 10 kPeBeTkO_vs16 29 Oct 2019 22:54 Re: WA 10 Peshkov [57 lyceum tlt] 26 Jun 2020 16:05 |
| If you WA at test 6, this test may help you | Dylan Harris | 1752. Tree 2 | 25 Jun 2020 15:10 | 1 |
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 |
| Getting WA on test 4 | ivzh | 2108. Oleg and Little Ponies | 24 Jun 2020 12:36 | 1 |
|
| test WA 12 | Mapu | 2067. Friends and Berries | 23 Jun 2020 17:16 | 2 |
Thanks! It can help on wa 13 too! |
| Why WA on test #4 | nikhil | 1084. Goat in the Garden | 22 Jun 2020 19:29 | 2 |
#include <bits/stdc++.h> #define gif(a,b) ((a)/(b)+((a)%(b)?1:0)) #define float long double #define int long long //#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); #define w(x) cout<<(#x)<<" is "<<(x)<<"\n"; using namespace std; int32_t main() { //IOS float a, r; cin >> a >> r; float theta = acos(a/(2*r));
float s = sin(theta);
float pi = acos(-1); if(a/2 > r) printf("%0.3Lf",pi*r*r); else if(r > a/pow(2, 0.5)) cout << a*a; else cout << (pi*r*r) - 4*(r*r*theta - a*r*s/2) ; return 0; } Проблема с точностью. исправьте "cout << (pi*r*r) - 4*(r*r*theta - a*r*s/2) ;" на "cout << fixed << setprecision(3) << (pi*r*r) - 4*(r*r*theta - a*r*s/2) ;". UPD: Попрошу не выкладывать свой код на форуме, он создан для обсуждения, а не для выкладывания на нем готовых решений. Поэтому прошу его убрать. Edited by author 22.06.2020 19:34 |
| why wrong answer?? | Rakibul Islam | 1086. Cryptography | 22 Jun 2020 15:50 | 1 |
#include<bits/stdc++.h> using namespace std; int primes[300001],nprime; int mark[1000002]; #define MAX_SIZE 1000005 void sieve(){ int i,j,limit = sqrt(MAX_SIZE*1.0)+2; mark[1]=1; for(i=4;i<=MAX_SIZE;i+=2)mark[i]=1; primes[nprime++]=2; for(i=3;i<=MAX_SIZE;i+=2){ if(!mark[i]){ primes[nprime++]=i; if(i<=limit){ for(j=i*i;j<=MAX_SIZE;j+=i*2){ mark[j]=1; } } } } } int main(){ sieve(); int n; cin>>n; while(n--){ int x; cin>>x; cout<<primes[x-1]<<endl; } } |
| Please, anybody know What is the TEST #6 ? | dake | 1110. Power | 22 Jun 2020 09:08 | 2 |
Edited by author 26.10.2013 22:11 |