CHEFGR cant find in practice

can you help me find Chef and Ground problem in practice? [CHEFGR]

I saw the problem in the COMPETE and worked out the problem but I cant find it in practice. It would be a pleasure if someone help me find it so I can check if I did it right.

Here’s my code anyway.

#include <iostream>
#include <string>
using namespace std;

int main()
{
   int testCases, column, cubes, sum = 0, largest = 0, test = 0;
   cin >> testCases;
   for(int x = 1; x <= testCases; x++)
   {
       cin >> column >> cubes;
       int arr[column];
       for(int x = 0; x < column; x++)
       {
           cin >> arr[x];
           sum = sum + arr[x];
       }

       for(int x = 0; x < column; x++)
       {
           if(largest < arr[x])
            largest = arr[x];
       }
       largest = largest * column;

       if(largest - sum == cubes)
        cout << "Yes" << endl;
       else if(largest - sum != cubes)
       {
           test = (cubes-(largest - sum));

           if(test % column == 0)
            cout << "Yes" << endl;
           else
            cout << "No" << endl;
       }

       sum = 0;
       test = 0;
       largest = 0;
   }
   return 0;
}
1 Like

NEVERMIND GUYS, I have found it. Can you just help me with my algorithm on how to do it better?

use this chrome extension…https://github.com/swapagarwal/CodeChefSubmitHelper/tree/master/CodeChef%20Submit%20Helper …this will create a submit button on the compete page if the contest is over…and u can submit the problem there itself if the problem has been moved into the practice section…also another alternative is that just remove the contest code from the address bar and reload the page…if the problem is available in the practice section then that page will be loaded…http://discuss.codechef.com/questions/54321/unable-to-find-october-lunchtime-question-in-practise-set !!!

2 Likes
1 Like