Aayuushh19's blog

By Aayuushh19, history, 2 years ago, In English

void solve(){ ll a,b,c,d;cin>>a>>b>>c>>d; ll a1=a/b; ll c1=c/d; if(a1==c1){ cout<<0<<endl; } else if(a1%c1==0){ cout<<1<<endl; } else if(c1%a1==0){ cout<<1<<endl; } else cout<<2<<endl;

}

why I am getting TLE in this Program

https://codeforces.net/contest/1720/problem/A

  • Vote: I like it
  • -1
  • Vote: I do not like it

| Write comment?
»
2 years ago, # |
  Vote: I like it 0 Vote: I do not like it

because you have not check the condition, when a1==0 or c1==0.