Infytq advantage round

I tested(auto) this code against mine for random variables and they produce the same output and for mod the concept is same as this How to compute mod of a big number? - GeeksforGeeks

What did you mailed?
asking for editorial or saying that the test case were wrong?

I told them to kindly check there testcases as some test cases are wrong or may be I am wrong but please check that problem once . If u believe yourā€™s solution is also right please mail them , then only we will get something , other wise one mail canā€™t do anything .

email pleaseā€¦

infytq@infosys.com

infytq@infosys.com

It is correct. I even wrote a stress test in the middle of the contest.

Since almost everyone had this issue (1 TC pass other WA) i think something was wrong was the tests.

I donā€™t think mailing them would do anything. I doubt that platform supports rejudging. If the tests are wrong, then what a pathetic contest, why couldnā€™t they hire some actual testers who can actually code.

1 Like

I donā€™t know what is wrong with this problem , waste a lot in debugging it but only one TC passed
MY APPROACH : store the char digits of string in a vector of int(by doing S[i]-ā€˜0ā€™), then

`soln.cpp

then just form a number from the vector of digits with modulo.

If you did triplets please share approach

I had the 9 am slot,
problem 1 - Calculate unique triplets, only got 1 TC correct with greedy
problem 2 - We have a string which only contains ā€˜aā€™, ā€˜bā€™ and ā€˜cā€™. We have an integer K. We can change a contiguous segment of length K of the given string to any one of the three letters. Find the maximum length of a contiguous segment which has the same letters.
Problem 3 - two bags X and Y, integers from 1 to N are distributed in these bags. Input - 2 integers, sum of all the digits in the bags. Find the minimum number of integers whose sum is equal to the sum of digits in bag X, if not possible print -1.

1 Like

How did you write stress test in the middle of the contest? We werenā€™t allowed to leave fullscreen mode.

Itā€™s weird that king of string wasnā€™t able to solve a string problem :sweat_smile:just a joke xd.

The same problem from CodeForces is here, but in that, we donā€™t have to do modulo operation. I was able to get only 50% points on this question.

I discussed this problem with my friends and got to know that the ones who misread the problem statement/implemented an incorrect logic got more than 30% of the test cases passed, while the ones with the right implementation got only 4% (1 TC) of the test cases passed.
There must be something wrong with the test cases for sure.

LOL, I too got 4% earlier when I maximized my input string after performing the operation once but what if we donā€™t do that operation. I didnā€™t consider this case at first but at last the answer will me

ans  = max(input string  % mod , changed string %mod) 

After doing this I got 50% points.

But we are supposed to return the maximum_number_that_can_be_obtained % mod, right?

If there is a way of maximizing the input string, then that maximised string is what we should be applying the modulo on.

And if there is no way the input string can be maximised, then the input string itself is our maximised string.

In any case, the answer would be maximised_string % mod.

I think we should print maximised_string % mod, rather than the maximum value that can be obtained after applying the mod.

Please let me know if Iā€™m missing something here.

1 Like

You can check it with this example :wink:

Input String :  9953758415988 
Input Array :  [8, 6, 2, 8, 7, 4, 5, 4, 3]
String modulo 1000000007:  758346317 (call it as ans1)
String After Maximising  : 9973758415988 
Now String modulo 1000000007: 758346177 (call it as ans2 ) 
Clearly ans1 > ans2 

For the codeforces problem, I get accepted verdict with my approach, thatā€™s a relief, but this means that there is a chance that they want the final ans after modulo to be the largest, right?
So any ideas on how we can do that?

I used sliding window technique in this problem my logic of string making was correct but after lots of try I was able to pass only 30% of testcases . I think the question was missing some thing or we were not able to find .

According to the question we need to maximize the answer, not the answer we are getting after doing the modulo operation.

2 Likes