求助E题为什么wa了

include<cstdio> #include<iostream> #include<algorithm> #include<cmath> #include<cstring> #include<sstream> #include<stack> #include<map> #define INF 1e9 #define mod 100003 using namespace std; const int maxn=1000; typedef long long ll; map<int,int>mp;   int main(){     int n,m;  scanf("%d%d",&n,&m);  if(m==n){   puts("Yes");   return 0;  }  else if(m==1){   puts("No");   return 0;  }  else{  int flag=0; while(n>=m){             n=n%m+n/m;     if(n==1){flag=1;}             }     if(flag==1)puts("Yes");     else         puts("No");     }  return 0;
}
求助E题为什么wa了?

全部评论
m==1并且n==1的情况和 m==1并且n!=1的情况你考虑一下
点赞 回复 分享
发布于 2022-08-11 21:06

相关推荐

06-26 17:24
已编辑
宁波大学 golang
迷失西雅图:别给,纯kpi,别问我为什么知道
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务