| Показать все ветки Спрятать все ветки Показать все сообщения Спрятать все сообщения |
| 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 |
| WA5 solution | esbybb | 2098. Тем ниже Приоры | 27 апр 2020 13:25 | 4 |
double dif = Math.abs(oform - neoform); if (oform > neoform && dif > 0.000001) { System.out.println("Cash"); } else { System.out.println("Insurance"); } It really helps me to get AC. Thank you Edited by author 23.10.2016 14:05 Edited by author 23.10.2016 14:05 |
| Why my code is wrong???C++ | RI_190010_11 | 1297. Палиндромы | 27 апр 2020 01:31 | 1 |
#include <iostream> #include <string> #include<vector> using namespace std; string turn(string s) { string news; for (int i = s.length() - 1; i >= 0; i--) news.push_back(s[i]); return news; } int main() { string s; string news; getline(cin, s); vector <int> l; vector <string> counts; for (int i = 0; i < s.length(); i++) { int n = s.length(); for (int j = 1; j <= s.length() - n + 1 && (s.length() - n + 1) <= (s.length() - i); j++) { news = s.substr(i, j); if (turn(news) == news && news.length() > 1) { l.push_back(news.length()); counts.push_back(news); } n--; } } int maxl = 0; string saves; for (int k = 0; k < l.size(); k++) { if (l[k] > maxl) { maxl = l[k]; saves = counts[k]; } } cout << saves; } |
| Some test | Kollekcioner[Vologda, VML1] | 1416. Для служебного пользования… | 25 апр 2020 06:26 | 8 |
Some test Kollekcioner[Vologda, VML1] 15 авг 2007 00:23 If you have WA25 and low try this test: 8 9 1 2 1 2 3 5 3 4 3 4 5 4 3 6 1 3 7 2 3 8 9 6 8 9 7 8 8 AC answer: Cost: 24 Cost: 25 What? The right answer should be Cost: 24 Cost: -1 Reply to the upper Edited by author 04.04.2011 20:38 I think answer should be 24 24, as my program does. We can replace 3->8 with 3->6 and it changes nothing. In fact,it changes; What my program shows is 24 25 |
| WA#2 Help PLS | Virus TI | 1383. Проекты цветника | 21 апр 2020 20:35 | 2 |
I can't figure out where my mistake is. Can someone give me some tests? lol Edited by author 21.04.2020 20:37 Edited by author 21.04.2020 20:37 Edited by author 21.04.2020 20:37 Edited by author 21.04.2020 20:37 Edited by author 21.04.2020 20:37 Edited by author 21.04.2020 20:37 Edited by author 21.04.2020 20:37 Edited by author 21.04.2020 20:37 Edited by author 21.04.2020 20:37 Edited by author 21.04.2020 20:37 Edited by author 21.04.2020 20:38 Edited by author 21.04.2020 20:38 Edited by author 21.04.2020 20:38 Edited by author 21.04.2020 20:38 Edited by author 21.04.2020 20:38 Edited by author 21.04.2020 20:38 Edited by author 21.04.2020 20:38 Edited by author 21.04.2020 20:38 Edited by author 21.04.2020 20:38 Edited by author 21.04.2020 20:38 |
| ( JAVA ), My Code is Running Fine (ACCEPTED) ( See it through for reference ) - Maximum | Gaurav Meena | 1079. Максимум | 21 апр 2020 00:45 | 1 |
import java.util.*; public class Maximums { public static void main(String[] args) { Scanner scn = new Scanner(System.in); int N = -564646878; // random value hehehehe while (N != 0) { N = scn.nextInt(); if (N == 0) { break; // As per the problems requirement it should terminate at 0 } else if (N == 1) { System.out.println(1); } else { N = N + 1; // problems indexing are upto N int[] arr = new int[N]; // creating an array to create desired sequence arr[0] = 0; arr[1] = 1; // initialising the array with the given values in question int max = Integer.MIN_VALUE; // to start with for (int i = 2; i < N; i++) { if (i % 2 == 0) { arr[i] = arr[i / 2]; // for even indexes if (arr[i] > max) { max = arr[i]; // comparing }} else { arr[i] = arr[(i - 1) / 2] + arr[((i - 1) / 2) + 1]; // for odd indexes if (arr[i] > max) { max = arr[i];// comparing }}} System.out.print(max); // finally printing the max value upto the given index 'N'. System.out.println(); // for new line ( P.S. I know i could have made the upper line to println but that's boring }}}} /// Happy Coding Dudes n Dudettes |
| why | CyberNinjaH23 | 1079. Максимум | 21 апр 2020 00:36 | 2 |
why CyberNinjaH23 26 янв 2020 15:01 why is the 10th element 4? isn't it 3? Ummm, I have got my answer accepted and I must tell you that you're right about the value is 3. Well, it's the answer value which is 4. Because 4 is the maximum value among all values up to the 10th index. i.e. 0 1 1 2 1 3 2 3 1 {4} 3 <----- Respected Values 0 1 2 3 4 5 6 7 8 9 10 <----- INDEX I hope that helped. If not ping me. I'll send you my solution. ping me at my ain't account - id (aquarius_gaurav). Peace. Edited by author 21.04.2020 00:36 |
| wa 11 | Abid_Jawad | 2072. Садовод Кирилл 3 | 20 апр 2020 17:13 | 2 |
wa 11 Abid_Jawad 12 апр 2020 20:07 a silly mistake got me wa. A simple testcase helped me. here it is- 3 3 2 1 Edited by author 12.04.2020 20:09 |
| W11 | zhuangqf | 2072. Садовод Кирилл 3 | 20 апр 2020 17:08 | 6 |
W11 zhuangqf 4 ноя 2015 17:51 answer will be long or long long. Thank you!!! That is very helpful! Appreciate your suggestions!Nearly died with laughing!!!!Fage JJ boom the sky!!! thank you very much for your suggestion!!!! |
| How come the suboptimal algorithms get accepted? | waddlepoof | 1200. Рога и копыта | 20 апр 2020 12:07 | 1 |
I mean, there obviously must be some compiler optimizations that enable the O(K^2) algorithm to be accepted for the worst case. For example, I've tried binary search, given that this is a convex function, and the amount of branch prediction misses slows the thing down a lot. I've been looking at godbolt.org output and can't figure out what is happening here. |
| 3 times wa | abid1729 | 1183. Brackets Sequence | 20 апр 2020 00:59 | 1 |
firstly i get wa on 8, then 9,then 13 And finally AC on .001 |
| Incomplete tests | vtalgo20_NAkatyev | 1628. Белые полосы | 19 апр 2020 23:55 | 1 |
Got AC with a program that had a 100% wrong answer on this test: 1 5 2 1 2 1 4 _ _ _ _ _ | |X| |X| | Definitely should be 3 (as we got 3 1x1 stripes separated by black cells), my prog got 2 and got AC. Dont know if adm reads this but why not - good to know for everyone Also hi to all ITMO vtalgo dudes <3 |
| 1201 is stupid! | Dmitry 'Diman_YES' Kovalioff | 1201. Какой сегодня день? | 19 апр 2020 02:55 | 3 |
Fucking participants! This problem is the most stupid problem I have ever seen. Why the problem is to output the calendar but not to find the day of week? It is very simple to find but it is IMPOSSIBLE to output! The sample does not give the answers to many questions. Why I MUST GUESS, GUESS and GUESS again? ... Diman_YES[UT], the leader of Universal Team I think, you're wrong. The format of output data is rather clear, and the only thing, not mentioned in the problem statement is that one has to output [.n] when current date is less than 10. IMHO problem 1177 is rather worse from this point of view. I think, you're wrong. The format of output data is rather clear, and the only thing, not mentioned in the problem statement is that one has to output [.n] when current date is less than 10. IMHO problem 1177 is rather worse from this point of view. Jesus Christ !!! I had thought that maybe that was why (putting a space to the left between the brackets when the number had a single digit) that WA had in test2, but I didn't believe it. In fact I assumed that in this problem the spaces were irrelevant. I find it terrible!, "[1]" incorrect and "[ 1] ([.1])" correct, for such nonsense one should not have a WA, much less if the problem does not specify it explicitly. And it is a pity because it is a beautiful problem. Thanks for clarifying this. |
| What's test 21? | Hakkinen | 1085. Встреча | 18 апр 2020 22:27 | 3 |
I wa many times. Thank you very much! I know,I used "<money[i]" You should use "<=money[i]" oh thanks, man, it helped me) |