20170905
水题:
![](https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif)
#include<cstdio> int main() { bool flag=false; long long l,r,x,y,k; scanf("%lld%lld%lld%lld%lld",&l,&r,&x,&y,&k); for(int i=x;i<=y;i++) if(k*i>=l&&k*i<=r) { flag=true; break; } if(flag==false) printf("NO"); else printf("YES"); return 0; }
错误原因:忽略了a和b都是整数
错误代码:
![](https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif)
#include<cstdio> int main() { long long l,r,x,y,k; scanf("%lld%lld%lld%lld%lld",&l,&r,&x,&y,&k); if(k*y>=l&&k*x<=r) printf("YES"); else printf("NO"); return 0; }
T2
![](https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif)
#include<cstdio> #include<cmath> #include<algorithm> using namespace std; double d,r; int ans,n; int main() { double x,y,r,p,p2,r2; scanf("%lf%lf",&r,&d); scanf("%d",&n); for(int i=1;i<=n;i++) { scanf("%lf%lf%lf",&x,&y,&r2); p=sqrt(x*x+y*y); p2=min(p-r+d,r-p); if(r2<=p2) ans++; } printf("%d",ans); return 0; }
智商题
T3
T4
T5