When this program ran with input 63923 99999, it stopped giving the title message . Anyone please help me to figure out what i am doing wrong with this code. After checking with some assert inserting and even doing debug i can't able to figure out the problem with this code. this is my code :
#define _CRT_SECURE_NO_WARNINGS
#include<cstdio>
#include<vector>
#include<iostream>
#include<string>
using namespace std;
#define ll long long
#define f(t,i,s,r) for(t i=s;i<r;i++)
ll s, m;
vector<ll>v;
string g=" Good Choice", b=" Bad Choice";
bool update (ll x,ll count) {
if (count < m) {
x = (x + s) % m;
if (v[x] == 1) {
return false;
}
else {
v[x] = 1;
return update (x, count+1);
}
}
else {
f (ll,i, 0, m) {
if (v[i] == 0)return false;
}
return true;
}
}
int main () {
freopen ("i.txt","r",stdin);
while (cin>>s>>m)
{
v.clear ();
v.resize (m,0);
v[0] = 1;
if (update (0, 1) == true) {
printf ("%10lld%10lld%s\n",s,m,g.c_str());
}
else {
printf ("%10lld%10lld%s\n", s, m,b.c_str());
}
}
}