Hi All.
The question is : https://www.codechef.com/problems/DISHLIFE
My solution is
#include <iostream>
#include <algorithm>
#include <unordered_set>
using namespace std;
int main()
{
int T,N,K,P;
unordered_set<int> In;
int val;
bool SOME;
cin >> T;
int siz;
for(int t=0; t<T;t++)
{
cin >> N >> K;
for(int i=1; i <= N ; i++)
{
cin >> P;
siz = In.size();
for(int j=0; j < P; j++)
{
cin >> val;
In.insert(val);
}
if( i <= N && In.size() == K )
{
SOME = true;
}
}
if(SOME )
{
cout << "some" << endl;
SOME = false;
In.clear();
continue;
}
if( In.size() == K)
{
cout << "all" << endl;
}
else if(In.size() != K && In.size() != 0)
{
cout << "sad" << endl;
}
In.clear();
}
return 0;
}
So I created a lot of random test cases and even cross verified the results with tester/setter solutions and got same output (then i realized the question was changed over the course) and hence checked with an accepted solution and it still failed
Can anyone of you help me with what i am missing and why my code fails for few sub tasks?
Thanks
Ashwath