Общий форум| Показать все ветки Спрятать все ветки Показать все сообщения Спрятать все сообщения | | illegal test data | Shen Yang | 1952. Убить дракона | 22 ноя 2016 06:23 | 4 | problem description said dragon will not use breath two times, but test 21 there is at least three breath in the input file... hope admin can fix it.. oops I misunderstood "in a row" is "in a row" means cosecutive?? I think we must use O(2^20*10) dynamic programming ,because there maybe two breath in a row brute_force will definitely got TLE | | WA#28 | Влад | 2102. Миша и криптография | 22 ноя 2016 02:28 | 1 | WA#28 Влад 22 ноя 2016 02:28 | | WA#11 | Anton | 1302. Дельта-волна | 22 ноя 2016 00:01 | 2 | WA#11 Anton 16 авг 2012 07:09 Don't know, what else to test ... Any ideas? Re: WA#11 AGrigorii [Yaroslavl SU] 🔥 22 ноя 2016 00:01 | | AllWhoWantsToSolveThisProblem | Felix_Mate | 2109. Туризм на Марсе | 21 ноя 2016 21:45 | 2 | I think many people can not solve this problem because they do not have enough knowledge. You should know "Problem LCA" and "Segment Tree" that to solve the problem. My algo is O(n*sqrt(n)+m*log(n)), but i can solve for O(n+m*log(n)) (LCA can be solved for O(1) with preprocess or sqrt(n) without preprocess). P.S. What is the optimal asymptotic behavior? Edited by author 20.11.2016 23:27 Edited by author 20.11.2016 23:27 Edited by author 20.11.2016 23:28 Well, there were quite a lot of LCA + segment tree problems by now, so by now people mostly should know what that is :) As for me, i just took my solution to http://acm.timus.ru/problem.aspx?space=1&num=1471 and only had to modify it very slightly. Just, in there you had to operate with only minimums, and here you need to find a minimum in a certain range of your array of minimums, so there's that additional layer of minimums. | | WA 18 ? | bayram | 1495. Раз-два, раз-два 2 | 21 ноя 2016 20:30 | 2 | | | java ac | pay_all_for | 1725. Аншлаг, аншлаг! | 21 ноя 2016 12:23 | 3 | java ac pay_all_for 3 авг 2014 07:02 import java.util.Scanner; public class Sold_Out { public static void main(String[] args){ Scanner scan = new Scanner(System.in);
int n = scan.nextInt(); int k = scan.nextInt();
if(n<3){ System.out.println(0); return; }
System.out.println(Math.max(k - 1, n - k) - 2); } } your programm works only because of weak tests. for example: 3 1 your answer is 0, but the correct one is 1. 1 _ _ 1 _ 3 1 2 3 -> there is 1 person from both sides and the distance to number 2 is equal, so in the worst case the person will hit vasya. Edited by author 13.01.2016 01:14 Edited by author 13.01.2016 01:14 | | sample output | 140701425 | 2104. Игра с полоской | 20 ноя 2016 13:37 | 1 | Could anyone give me some sample input and output? Thanks a lot. | | wrong ? | Vadim | 2101. Рыцарский щит | 20 ноя 2016 11:57 | 2 | Nope. The only inscribed rectangle with area=50 doesn't contain hole. Note, that there are only 4 possible rectangles in the solution. | | Hint | Takanashi Rikka | 1118. Нетривиальные числа | 20 ноя 2016 01:52 | 4 | Hint Takanashi Rikka 26 фев 2016 09:12 Calculates sum of divisors. O(lim * log(lim)). for(int i = 2; i <= lim; ++i){ ++s[i]; for(int j = i + i; j <= lim; j += i) s[j] += i; } Maybe I don't understand it clear, but I think it will get TL. Difficult of this algorithm = O(n^2) No, it's O(n log n). Learn some math. | | long is not enough | AfraidDiablo | 1010. Дискретная функция | 20 ноя 2016 00:09 | 2 | In C++, you'd better use "long long" instead of "long". | | Ошибка в исходном примере? | jazator | 2104. Игра с полоской | 19 ноя 2016 18:16 | 2 | 4 BBAA BABB = Bob Почему в исходном примере выигрывает Боб? Если при первом сгибе получаем полоску АА, значит должна выиграть Алиса... Почему нет? There is information:"Если после очередного сгиба полоска стала полностью одноцветной".It's mean, both of sides needs to have one color | | Board of directors | Emiliyan Greshkov | 2103. Корпоративная почта | 19 ноя 2016 15:45 | 2 | Can members of the director board be subordinates? For example, is 6 a subordinate of 3? Yes, 6 is a subordinate of 1, 2, and 3. Edited by author 19.11.2016 15:45 | | если отправитель равен получателю | the_art_of_war | 2103. Корпоративная почта | 19 ноя 2016 15:41 | 2 | Для теста 5 5 что нужно вывести 0 2 5 5 или 0 1 5 "An employee can send a memo only to another employee. The route of memo can consist of one employee." So the answer should be 0 1 5. | | WA#4 | Giorgi | 1423. Басня о строке | 19 ноя 2016 03:00 | 1 | WA#4 Giorgi 19 ноя 2016 03:00 A can't understand what's the problem and why I don't pass it. Help me, please. | | What is 56th test | Mukhammadali | 2011. Длинное условие | 18 ноя 2016 20:52 | 1 | | | Can somebody help me, please | Abbos | 1931. Отличная команда | 18 ноя 2016 20:25 | 3 | What's the meaning of the question ? I tried to get it but in vain, even the test unclear for me I'll explain the test. 6 2 5 3 4 1 9 The first one is chosen as current candidate, and has 2 disadvantages. Then, he is compared with 2nd pirate (5 disadvantages), 3rd (3), 4th (4), 5th (1). When comparing with 5th pirate, we see that he has less disadvantages (1) than current candidate (2). So he becomes the current candidate. And then we finally compare him with last pirate (9 disadvantages). In the end, 1st pirate with 2 disadvantages was compared to 2nd, 3rd, 4th, 5th — compared 4 times; 2nd pirate with 5 disadvantages was compared to 1st — compared 1 times; 3rd pirate with 3 disadvantages was compared to 1st — compared 1 times; 4th pirate with 4 disadvantages was compared to 1st — compared 1 times; 5th pirate with 1 disadvantages was compared to 1st, 6th — compared 2 times; 6th pirate with 9 disadvantages was compared to 5th — compared 1 times; Out of all the pirates, the 1st one has the most compare times — 4. Thus, we output 1 — the index of a pirate who was compared most times. But, if several pirates were compared the same amount of times — say, if 5th one was also compared 4 times (if there were 2 more pirates in input) — then both answers "1" or "4" would be correct in this case. Is this any clearer? | | can anyone explain the problem description please? | Shen Yang | 1388. Фотография | 18 ноя 2016 16:48 | 1 | thanks I want to know what's the task of this problem. | | An interesting way of coding it | Egor | 2010. Юный гроссмейстер Саша | 18 ноя 2016 02:11 | 1 | There is an interesting way to code it. For each piece we can have a function like this: pair<string, int> get_king(int n, int x0, int y0) { int cnt = 0; for (int dx = -1; dx <= 1; dx++) for (int dy = -1; dy <= 1; dy++) if (dx != 0 || dy != 0) { int x = x0 + dx; int y = y0 + dy; cnt += (x >= 1 && x <= n && y >= 1 && y <= n); } return { "King", cnt }; } In the main code we just do the following loop: for (auto get : { get_king, get_knight, get_bishop, get_rook, get_queen }) { auto res = get(n, x, y); cout << res.first << ": " << res.second << endl; } After that the function for queen look very easy: pair<string, int> get_queen(int n, int x0, int y0) { int cnt = get_rook(n, x0, y0).second + get_bishop(n, x0, y0).second; return { "Queen", cnt }; } If you have any ideas on how to code it better, please write them here :) | | WA9, I'm check all forum topic, all test success, but WA9. Please!!! | phfaster | 1005. Куча камней | 17 ноя 2016 19:04 | 1 | My tests (N, Array, Answer): [8, '6 7 9 13 18 24 31 50', 0], [5, '5 5 4 3 3', 0], [5, '3 3 4 5 5', 0], [1, '1', 1], [1, '2', 2], [6, '1 4 5 6 7 9', 0], [5, '5 8 13 27 14', 3], [5, '5 4 3 3 3', 0], [5, '11 10 8 7 6', 0], [6, '1 4 5 6 7 9', 0], [6, '9 7 6 5 4 1', 0], [7, '1 2 3 4 5 6 6', 1], [3, '1 1 5', 3], [6, '1 2 3 4 100 100', 0], [5, '5 8 13 14 15', 1], [5, '4 6 6 7 9', 0], [7, '36 25 12 10 8 7 1', 1], [6, '101 51 51 3 2 2', 0], [6, '1 4 5 6 7 9', 0], [4, '1 3 9 27', 14], [6, '6 6 5 4 3 2', 0], [20, '1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20', 0] All tests = True. What I do wrong? Edited by author 17.11.2016 19:27 Edited by author 17.11.2016 20:03 | | K based numbers, containing N digits modulo M | sleepwalker | 1013. K-ичные числа. Версия 3 | 17 ноя 2016 18:22 | 1 | What does it mean? For example if K = 10, N = 3, M = 112 correct numbers are 101 102 103 104 105 106 107 108 109 110 111 Is it right? Thanks. Edited by author 17.11.2016 18:22 |
|
|