题解 | #可乐#

可乐

https://ac.nowcoder.com/acm/problem/16037

#include using namespace std; int main(){ int n,m,k; cin>>n>>m>>k; double s[10000]; for(int i=0;i<k;i++){ double x,y; cin>>x>>y; m=(double)m; n=(double)n; s[i]=(m*x+(n-m)*y)/n; } double max=-10000; int r=0; for(int i=0;i<k;i++){ if(s[i]>=max){ max=s[i]; r=i; } } for(int i=0;i<k;i++){ if(r!=i){ cout<<0<<" "; } else cout<<n<<" "; } return 0; }

全部评论

相关推荐

1jian10:48h没写面评会变成这样
点赞 评论 收藏
分享
评论
1
收藏
分享

创作者周榜

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