Common Boarda 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 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!!!! 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. firstly i get wa on 8, then 9,then 13 And finally AC on .001 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 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. 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) 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;   } Could anybody suggest the 3-rd test???? i don't know my mistake. :-( 5 5 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 the right one is 1 perhaps your programme give 0 A very useful test data! Thanks a lot can't be! i'm fighting with 3rd test for more than hour. And when i test your numbers i get 1 as answer, but still not passing test. Ho to fix WA on test 18? This test case helped me:   2 3 0 99999 100000 0 100000 99999   answer: 100000 2 3 1 2 3 3 2 3 1 1 2 2   answer is 2 The first test is something like this 4 4 1 2 1 2 3 1 3 4 2 4 1 1   I hope this helps you Подумайте о пересечение прямой из данных двух точек с окружностью а потом о треугольниках   Edited by author 16.02.2020 19:45 И ни в коем случае не думайте о зебрах phi(n) is not equal to number of coprime less than n, IT IS THE NUMBER OF COPRIMES LESS THAN OR EQUAL TO N. the formula of phi(n) work for all except a special number. give me this test please.. 6 1 3 2 5 4 6   Answer: 27   May be this is not 5th test, but if you can solve this, you'll understand what's wrong in your current solving. :-) Can you explain it to me, how you get 27? Achtung! Time limit exceeded Error :( does anyone knows test 5? thank you! big number(10000 maybe) and time more 1 sec. Putting the intermediary values in long double won't work, At least I couldn't get them to work. Putting them in long long and dividing at the end also won't work. You'll have to do something between these two ( ͡° ͜ʖ ͡°)  |  
  |