| Показать все ветки Спрятать все ветки Показать все сообщения Спрятать все сообщения |
| WA#25 | petr | 1444. Накормить элефпотама | 7 май 2020 02:41 | 2 |
WA#25 petr 12 май 2014 01:53 I can not make tests for which the program gives an incorrect result. Help please My program failed at WA#25 because my 'getAngle' function returned negative results instead of [0; 360), so try to check your sorting code |
| Key hint | ajay jadhav | 1494. Монобильярд | 5 май 2020 23:55 | 1 |
Inspector can come at any point. after 1 ball pocketed after 2 ball pocketed or even at the end when n balls are pocketed Inspector can collect any number of available balls e.g if he comes after ball 3 is pocketed he can take just 3, or 3 2 or all 3 2 1 |
| 0.031s 312KB C++ sulotion | panhantao | 1028. Звёзды | 5 май 2020 19:56 | 7 |
I've been stuck in this problem for a very long time, but today I got the idea of Binary Indexed Tree from wikipedia and finally solved this problem :) Binary Indexed Tree,or BIT, can be viewed as a simplified version of Segment Tree,easier to code and less function to perform. But It's enough to solve this problem #include<iostream> #include<cstdio> using namespace std; const int Max = 32005; int n; int c[Max] = {0}; int level[Max] = {0}; int lowbit(int x) { return x&(-x); } int sum(int i) { int s = 0; while(i > 0) { s += c[i]; i -= lowbit(i); } return s; } void update(int pos,int val) { while(pos <= Max) { c[pos] += val; pos += lowbit(pos); } } int main() { scanf("%d",&n); for(int i = 0; i < n; i ++) { int x,y; scanf("%d%d",&x,&y); x ++; level[ sum(x) ] ++; update(x,1); }
for(int i = 0; i < n; i ++) printf("%d\n",level[i]); } How can this even be correct if you don't use the y-coordinates at all? Because in statement there was written that y-coordinates are already sorted in function main,why you use "x ++"? cose in problem x in [0,32000 ] so 0 is bad value for binary :) so we just shift all x on some const ( just 1) so all value between 1 and power(2,someN) Why do you use 32005 as a size of an array? Because it is given in constraint. That x and y values will be less than 32000. |
| Doubt about my AC. | ajay jadhav | 1586. Трипростые числа | 5 май 2020 00:31 | 1 |
I have two loops which calls recursive function for 1 to 9 for 0 to 9 ans+=f(n-2,j,i) // f(rem,prev,prev_prev) function f(i,j,k) has dp[1001][10][10] memoized solution.why doesnt it timeout. I'm having hard time understanding my own solution although it is ACd in one trial. |
| What is test 6? | Keiby | 2035. Очередной пробный тур | 4 май 2020 18:52 | 3 |
may be anybody know? Edited by author 13.09.2016 16:35 Edited by author 13.09.2016 16:35 Edited by author 04.05.2020 18:52 |
| mayus are very important my guys | lRider | 2012. Про Гришу Н. | 3 май 2020 22:20 | 1 |
|
| Hint and tutorial | blunder woman | 1039. Юбилейная вечеринка | 3 май 2020 13:34 | 2 |
I did not write this tutorial btw |
| Some Test | TestT | 1043. Закрыть дугу | 3 май 2020 07:17 | 6 |
Test 01: 10 15 15 10 13 14 Ans 01: 25 Test 02: 0 5 5 0 1 1 Ans 02: 36 Test 03: 10 15 13 14 15 10 Ans 03: 100 Test 04: 10 15 13 14 15 10 Ans 04: 100 Test 05: 10 15 13 14 15 10 Ans 05: 100 Test 06: 2 1 1 2 1 1 Ans 06: 4 Test 07: 200 200 200 300 300 200 Ans 07: 17182 Test 08: 300 300 301 301 500 101 Ans 08: 80089 Test 09: 400 400 400 410 700 405 Ans 09: 90600 Test 10: 11 16 14 11 13 14 Ans 10: 15 Test 11: 4 1 1 6 2 2 Ans 11: 20 Test 12: 11 13 14 19 12 16 Ans 12: 18 Test 13: 11 14 14 20 12 18 Ans 13: 24 Test 14: 100 110 110 100 108 106 Ans 14: 100 Test 15: 100 110 90 100 94 108 Ans 15: 100 Test 16: Ans 16: Test 17: Ans 17: Test 18: Ans 18: Test 19: Ans 19: Test 20: Ans 20: Test 21: Ans 21: Test 22: Ans 22: Test 23: Ans 23: Test 24: Ans 24: Test 25: Ans 25: Test 26: Ans 26: Test 27: Ans 27: Test 28: Ans 28: Test 29: Ans 29: Test 30: Ans 30: Test 31: Ans 31: Test 32: Ans 32: Test 33: 1 -1000 -1 -1000 999 0 Ans 33: 3998000 Test 34: Ans 34: Test 35: 1 1 11 -1 2 0 Ans 35: 30 Test 36: -200 100 -300 -200 -195 -2 Ans 36: 32400 Test 37: -10 -5 -5 -10 -5 -100 Ans 37: 18496 Where the people find these tests? Edited by author 27.07.2007 01:01 Edited by author 27.07.2007 01:01 khmm. I don't know, what kind of cheat did you use, but it was very useful help. After some manipulations with precision, finally AC! Thank you Edited by author 17.08.2008 01:05 Thanks a lot! I didn't think about tests where some parts of circumstance could lie beyond the sqare[-1000, 1000]. Why test2 has answer 36? it seems that correct answer is 25. Yes, answer is correct. Center - 3.83333 3.83333 radius - 4.00694 x_min ~ -0.173605 < 0 y_min ~-0.173605 < 0 S = 36 |
| WA#39 Can you help me? | SergeyGlazkov | 1854. Переговоры с Парфией | 3 май 2020 00:06 | 1 |
I understood my problem. It is about calculating sqrt, import math in python doing it wrong with very big numbers. Edited by author 03.05.2020 00:55 |
| WA25 | Ulugbek#& | 1346. Интервалы монотонности | 2 май 2020 20:37 | 2 |
WA25 Ulugbek#& 30 апр 2020 09:32 does anybody have idea what it can be? Just retype your code in other language. For ex. C++, and you'll get AC. The reason is this site hates python and java coders :( Don't stop reading while not EOF Edited by author 02.05.2020 20:40 |
| Memory Limit Exceeded with 70KB memory usage. | Samarendra Dash | 1439. Поединок с И-Так-Понятно-Кем | 2 май 2020 18:25 | 1 |
I am using a solution, where I store all the doors in a BST, and if door k is to be deleted then I delete the kth smallest element in the BST. Same for lookup, I search the kth smallest and print the number. In test case 2 it is showing memory limit exceeded with only some 66-69KB memory usages. But the question says 64MB memory is allocated. Then why is this happening? (I am using C++ to code this.) |
| ENDLINE | texa_hero | 1149. Танцы синуса | 2 май 2020 00:53 | 1 |
Don't forget to make an endline in your pretty code.... |
| БОЯН | Toshpulatov (MSU Tashkent) | 2080. Карточки | 1 май 2020 23:54 | 1 |
БОЯН Toshpulatov (MSU Tashkent) 1 май 2020 23:54 Ровно этаже задача на региональном этапе для школьников 2018-2019 год |
| Can you solve it in python within the time limit? | LearningPython | 1104. Не спрашивай даму о возрасте | 1 май 2020 05:51 | 3 |
My python 3.3 program has TLE in problem 12. Has anyone a hint to speed up this algorithm. Changing to python 2.7.5 was enough to get AC Tried to solve in Python 2.7.18 and Python 3.8.2. Time limit exceeded on test 12 with time 1.015 s. Rewrote it in C and got 'accepted' with 0.031 s. |
| I think testset for this problem isn't right | Maxim Kiryushin | 1314. Погоня в метро | 30 апр 2020 13:46 | 3 |
My AC program give answer 3 for a following test: 2 4 1 2 3 4 4 1 2 5 4 3 1 2 3 But I think answer must be: 3 4 Am I right? Yes. I think you are lucky you got AC. NO! My AC program give answer 3 for a following test: 2 4 1 2 3 4 4 1 2 5 4 3 1 2 3 But I think answer must be: 3 4 Am I right? |
| What does this sentence mean? | Failed Peter | 1314. Погоня в метро | 30 апр 2020 13:37 | 6 |
the length of a route is determined by the number of spans only But what's span?! Read following few words - definition of span is there (in the subway, a span is a tunnel between two adjacent stations). but i still don't know... Span are edges!(I have no word to say~~~) (in the subway, a span is a tunnel between two adjacent stations). but i still don't know... |
| WA2 | Dimitar Dimitrov | 1090. Теперь ты в армии | 29 апр 2020 23:28 | 3 |
WA2 Dimitar Dimitrov 20 июл 2009 16:16 Could you give me some test data ? Re: WA2 Tudor Zaharia 13 авг 2011 18:47 Re: WA2 blunder woman 29 апр 2020 23:28 Perhaps you accepted k,n instead of n, k as input. |
| Is it topological sort? | ajay jadhav | 1022. Генеалогическое дерево | 29 апр 2020 12:08 | 1 |
I did get AC on this. I used queue and in_degree array. First pushed zero in_degree elements in queue and then visited neighbour for each element in front , reduced in_degree of neighbours by 1 each time to indicate one parent has reduced. Edited by author 29.04.2020 12:08 |
| Where's wrong? | Farrux | 2066. Простое выражение | 28 апр 2020 14:13 | 2 |
import java.util.Scanner; public class Test{ public static void main(String[] args) {
Scanner sc = new Scanner(System.in); int a = sc.nextInt(); int b = sc.nextInt(); int c = sc.nextInt(); if(a>=0 && b>=0 && c>=0 && a<=100 && b<=100 && c<=100 && a<=b && b<=c ){ if(a==0 && b==0 || a==0 && b==1|| b==0||c==0||(a==1&& b==1&&c==1)){ System.out.println(a-b-c); } else System.out.println(a-b*c); } } } import java.util.Scanner; public class Test{ public static void main(String[] args) {
Scanner sc = new Scanner(System.in); int a = sc.nextInt(); int b = sc.nextInt(); int c = sc.nextInt(); if(a>=0 && b>=0 && c>=0 && a<=100 && b<=100 && c<=100 && a<=b && b<=c){ if(a==0 && b==0 || a==0 && b==1|| a==1&& b==1|| b==0||c==0||(a==1&& b==1&&c==1)){ System.out.println(a-b-c); } else System.out.println(a-b*c); } } } |
| What is test3? | yuyan | 1700. Пробуждение | 28 апр 2020 09:32 | 4 |
Can somebody give me some tests? I can;t find what's wrong with my prog. Thanks a lot. oh... very stupid error. you should use .clone() in java. now TLE 10 Edited by author 21.02.2010 18:22 10 years have passed) I hope it will help somebody. I had WA3, i forgot to clear vector after set intersection, very stupid mistake Edited by author 24.03.2019 23:54 Edited by author 24.03.2019 23:54 this test helped me: 2 a: fuck it b: fuck this shit 1 a b answer: fuck reason: I indexed the words from 0, but I should from 1 |