|
|
Common BoardURAAA! Hmm... :) I wanna see the code I managed to get 0.001s on 500 kB :D Send at night. Code is here: * deleted * Edited by moderator 23.07.2022 20:34 yordam kerak aka deleted Edited by author 08.09.2017 13:54 5 0 0 2 2 3 1 4 0 6 2 Answer: 5 Russian: Далее следуют M строк по 2 целых числа в каждой — координаты тараканов в настоящий момент. M + 2 строка содержит число ??? N (0 ≤ N ≤ 10000) ??? . Далее N строк — координаты кусочков сладости. Все координаты — действительные числа. English: M lines follow, containing 2 numbers each — these are coordinates of the cockroaches at the present moment. (M + 2)nd line of the input stream contains the number ??? N (0 ≤ N ≤ 10000) ??? . N following lines contain coordinates of sweet pieces. Can be the number of sweet pieces equal 0 ? So what will be the answer in this case ? Answer can be empty ? Edited by author 07.09.2017 17:23 Edited by author 07.09.2017 17:23 Задача - бомба! Подсказка - производная... Edited by author 07.09.2017 16:41 Edited by author 07.09.2017 16:41 I used greedy search on sorted edges in increasing order of sum of degrees of vertices (of edge). Should I refine my compare function? Other hints? I use dp,but W4.Who can give me some hints or tests. Thanks a lot. Though I don't know why I wa4 that time , I AC now without any change... may be it's time's power... Try 1 10 a1aaaa1aaaa1 Try 1 2 [space] [space] = " " My code in python 3.6: def is_palindrom(x): if x==x[::-1]: return True return False s=input() s=s[::-1] n=len(s) a=[] for x in range(2,n+1): for i in range(0,n-x+1): if is_palindrom(s[i:i+x]): a.append(s[i:i+x]) if len(a)==0: b=s[-1] else: b=a[-1] print(b) Memory is 70160 Kb, where so much it? Please, help, I would be grateful! I see you AC now What was the issue? Oh, sorry, it is other task Can somebody tell me why i get memory limit exceeded in test case #9... ???? i make an k-d tree and use nearest neighbor search in my solution and still have memory limit Edited by author 03.05.2013 07:52 Have you done it? i have memory limit in test 10 too (c++) Have you done it? i have memory limit in test 9 too (c++) Edited by author 05.09.2017 19:58 Edited by author 05.09.2017 19:58 Give me test#5? please!!! I tried all test from forum Kotlin compiler version 1.1.4 was added. See http://acm.timus.ru/help.aspx?topic=kotlin for more details. Here is a sample solution for A+B Problem: fun main(args: Array<String>) { val (x, y) = readLine()!!.split(' ').map(String::toInt) println(x + y) } Edited by author 05.09.2017 02:57On my PC it runs perfectly correct, the output is exactly the same(i have checked it using equals method so a mistake is impossible) but i get WA1 somehow. If somebody has an idea, please write it here. BTW I know that the first test is the sample test because a simple program that prints sample output gets WA2. PS here is my code if someone's interested: https://pastebin.com/SYiQTbMt Edited by author 04.09.2017 23:49 Edited by author 04.09.2017 23:49Do you think test case number one is the sample? Just try over and over again. My AC-program has wa when I try to submit it again. The same code has wa-1, wa-5, wa-7, wa-22, wa-30, ac, again wa... 5 10 1 2 1 3 1 4 1 5 2 3 2 4 2 5 3 4 3 5 4 5 -> Unlucky Petr I have solved it only after reading Felix Mate's comment about dynamic programming approach Of course you can do precalculation and AC with Python But it is really hard to AC with Python with "online" calculation What may be the test 54 ?? i try, but it isn't enough. give a hint, please (test #6) Edited by author 01.09.2017 07:46 done! What about test #9? every time Runtime error. what can be there? Edited by author 02.09.2017 05:39 #include <iostream> #include <cmath> #include <iomanip> #include <vector> #include<algorithm> using namespace std; int main() { long long a, c, d, min, max, n, x;
long double b, e, sum; cin >> a >> n; sum = 0; d = 0; vector<long long> z(n); for (long long i = 0; i < n ; ++i) { cin >> z[i]; } for (long long i = 0; i < n; ++i) {
b = z[i] / 3; sum = sum + b; d = d + 1; if (a < sum) { break; }
} if (a > sum) { cout << "Team.GOV!" << endl; } else { cout << "Free after " << d << " times." << endl; } return 0; } Thank you admins for nice new feature I am about additional information about task in forum Namely task name in addition to task number |
|
|