Reply to message- Messages should be written in English and correspond to the matter of the website.
- Messages should not contain offences and obscene words.
- Messages should not contain correct solutions.
what is the difference between this code and that code, still get wrong Posted by VNeo 16 Jul 2017 06:34 i got WA#6 when i use this code #include <iostream> #include <cmath> using namespace std; long int n,m,y,p,q,r[999]; int main(){ cin>>n>>m>>y; for (int i=0;i<m;i++){ if (lround(pow(i,n)) % m==y){ q++; r[q]=i; } } if (q==0){ cout<<"-1"; } else { for (int i=1;i<=q;i++){ cout<<r[i]<<' '; } } } but when i use neighbored code which is already acc, and tested some test case between them, it give me same results. whats probably wrong in my code by the way, the neighbored code is pascal language, but the point is, i just used that for test case.
|