Show all threads Hide all threads Show all messages Hide all messages |
I think testset for this problem isn't right | Maxim Kiryushin | 1314. Chase in Subway | 30 Apr 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. Chase in Subway | 30 Apr 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. In the Army Now | 29 Apr 2020 23:28 | 3 |
WA2 Dimitar Dimitrov 20 Jul 2009 16:16 Could you give me some test data ? Re: WA2 Tudor Zaharia 13 Aug 2011 18:47 Re: WA2 blunder woman 29 Apr 2020 23:28 Perhaps you accepted k,n instead of n, k as input. |
Is it topological sort? | ajay jadhav | 1022. Genealogical Tree | 29 Apr 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. Simple Expression | 28 Apr 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. Awakening | 28 Apr 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. Lada Priora | 27 Apr 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. Palindrome | 27 Apr 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. Confidential | 25 Apr 2020 06:26 | 8 |
Some test Kollekcioner[Vologda, VML1] 15 Aug 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. Flower-garden Designs | 21 Apr 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. Maximum | 21 Apr 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. Maximum | 21 Apr 2020 00:36 | 2 |
why CyberNinjaH23 26 Jan 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. Kirill the Gardener 3 | 20 Apr 2020 17:13 | 2 |
wa 11 Abid_Jawad 12 Apr 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. Kirill the Gardener 3 | 20 Apr 2020 17:08 | 6 |
W11 zhuangqf 4 Nov 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. Horns and Hoofs | 20 Apr 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 Apr 2020 00:59 | 1 |
firstly i get wa on 8, then 9,then 13 And finally AC on .001 |
Incomplete tests | vtalgo20_NAkatyev | 1628. White Streaks | 19 Apr 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. Which Day Is It? | 19 Apr 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. Meeting | 18 Apr 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) |
Judge, Please, Help! Why fail in test #2? this is code | Alexander J. Villalba G. | 1200. Horns and Hoofs | 17 Apr 2020 02:34 | 1 |
I don't understand why my code fails. I have been very careful with all cases. The precision of the numbers, the zero and negative benefits, everything. My code should not have so many lines but I have put them for the frustration of having so many WA. Are you sure test # 2 is ok? Check it with my code. Previously I tried it with a much shorter code that reached test # 7 and failed, but it did not take care of rounding problems, this does and fails in test # 2 X-¿ Help, Please! // Brute force #include <stdio.h> #include <math.h> long calcMax (int horn_n , int hoof_n, float horn_b, float hoof_b ) { long max = (long) horn_b * horn_n + (long) hoof_b * hoof_n - (long) 100 * ( horn_n * horn_n + hoof_n * hoof_n); return max; } int passtoInt( char *number) { int num = 0, signo = 1, begin = 0; char decimal_flag = 'N'; int dec_ndig = 0; if( number[0] == '-') { signo = -1; begin = 1; } for(int i=begin; number[i] != 0; i++) { if(number[i] == '.') { decimal_flag = 'Y' ; continue; } if(decimal_flag == 'Y') dec_ndig++; if(dec_ndig > 2) break; num = num * 10 + (number[i] - '0');
} for(int i = dec_ndig; i < 2; i++) num = num*10; return num * signo; } void getPartEntAndDec(long num, long *ent, unsigned *dec ) { *ent = num / 100; *dec = num % 100; } int main(void) { char horn_s[14], hoof_s[14]; int horn_n= 0, hoof_n = 0, horn = 0, hoof = 0;
int horn_b, hoof_b; long max = 0, max1, max_ent; unsigned max_dec; int maxmount; scanf("%s%s%d", horn_s, hoof_s, &maxmount); horn_b = passtoInt( horn_s); hoof_b = passtoInt( hoof_s); for(int horn_n = 0; horn_n <= maxmount; horn_n++) { for(int hoof_n = 0; hoof_n <= maxmount - horn_n; hoof_n++) { max1 = calcMax (horn_n , hoof_n, horn_b, hoof_b ); if(max1 > max) { horn = horn_n; hoof = hoof_n; max = max1; } } } getPartEntAndDec(max, &max_ent, &max_dec ); printf("%ld.%02u\n", max_ent, max_dec); printf("%d %d\n", horn, hoof); return 0; } |