CHECHOC - Editorial

@aditya04848 one of the most obvious case that failed n=1,m=1 and x<y answer should be x and not y

1 Like

base case cost me o god this time i might have reached 4 star.

Hi.
Can someone plz tell me the test case where my code is giving the wrong ouput
heres my submission
https://www.codechef.com/viewsolution/35965722

I am assigning max values matrix can have and then I am summing all the elements of matrix

any counter test case for this please.

https://www.codechef.com/viewsolution/36024987

Hey can you please point the error in this code I literally have no clue PLZ help.
https://www.codechef.com/viewsolution/36025013

This gay solution will give wrong answer when matrix is a square matrix like 33 or 44 but he got AC. Can any one explain how?

https://www.codechef.com/viewsolution/35981280
i had everything cool while i was going for a dry run, but ended up getting a WA. Pls can someone help me with this code

@omhari I think that is a big blunder mannnn

@iit_yt_28 One of the error you are not using endl if n==1 and m==1

1 Like

Jako Rakhe Sayian maar sake na koiā€¦ cannot be justified better than this.

1 Like

Thank you so much broā€¦

1 Like

@iiy_yt_28 that is why people say that debugging your own code is some time a hell lot of task

1 Like

To be honest I added the 1x1 code after looking at the editorial and then when it failed man I was depressed and sadā€¦ now I am ā€˜justā€™ sad that I missed 1x1. But thank you I think I would never had gone through my code againā€¦ this contest just blew the brains out of every1.

1 Like

@cherry0697 @yash_chandnani @rajarshi_basu
Not able to find the issue in my code. Please help!!
https://www.codechef.com/viewsolution/36025431

For n=1 and m=1 and y<x the answer is x and not y

1 Like

Untill now I used to think that I am the unluckiest man on the planet (honestly), but now I can say that my bro is right there with meā€¦

On more serious note plz see the 39th line in your code the problem is here ((m/2)*(n+1)/2) )*diff did you just miss a bracket here? just change the above to this ((n+1)/2)

1 Like

Well thank u very much for giving it timeā€¦
I seriously need to work on basic things now onwards,
PS- this is not first time with me,(sad)
anyways thanks a lott bud.

1 Like

Can anyone give any counter test? Iā€™m not finding any.
my solution: CodeChef: Practical coding for everyone

I just want to say one thing, all those people who have solved this problem and replying to people
very proudly ā€œyou missed the edge case 1*1, you can take x even if it is greater than yā€ you all people are stupid,you donā€™t have sense,you didnā€™t used your mind even for a moment.

And to the person who setup this problem,to the tester donā€™t feel proud of yourself after setting this problem,it was stupidā€¦

2 Likes

#include
#include<bits/stdc++.h>
using namespace std;
int main()
{
int t;
cin>>t;
while(tā€“)
{
long int m,n,x,y;
long int ans;
cin>>n>>m>>x>>y;
if(m==1&&n==1)
cout<<y<<endl;
else
{
long int k=0;
if(m%2==1&&n%2==1)
{
k=(mn)/2;
k++;
ans = k
y;
ans- -;
}
else
{
k=(mn)/2;
ans=k
y;
}
cout<<ans;
cout<<endl;
}
}
return 0;
}