【Codeforces Round #460 (Div. 2) A】 Supermarket
【链接】 我是链接,点我呀:)
【题意】
在这里输入题意
【题解】
就是让你求m*(ai/bb)的最小值
【代码】
#include <bits/stdc++.h>
#define double long double
using namespace std;
int n,m;
int main(){
#ifdef LOCAL_DEFINE
freopen("rush_in.txt", "r", stdin);
#endif
ios::sync_with_stdio(0),cin.tie(0);
cin >> n >> m;
double ans = -1;
for (int i = 1;i <= n;i++){
double a,b;
cin >> a >> b;
if (i==1){
ans = 1.0*m*(a/b);
}else ans = min(ans,1.0*m*(a/b));
}
cout << fixed<<setprecision(10)<<ans << endl;
return 0;
}
【Codeforces Round #460 (Div. 2) A】 Supermarket的更多相关文章
- 【Codeforces Round #460 (Div. 2) D】Substring
[链接] 我是链接,点我呀:) [题意] 在这里输入题意 [题解] 如果有环 ->直接输出-1 (拓扑排序如果存在某个点没有入过队列,说明有环->即入队的节点个数不等于n 否则. 说明可以 ...
- 【Codeforces Round #460 (Div. 2) C】 Seat Arrangements
[链接] 我是链接,点我呀:) [题意] 在这里输入题意 [题解] 用pre[i][j]表示第i行前j列的和. 然后枚举连续座位的最左上点. (有两种可能向右或向下k个. 则还需要处理出pre2[i] ...
- 【Codeforces Round #460 (Div. 2) B】 Perfect Number
[链接] 我是链接,点我呀:) [题意] 在这里输入题意 [题解] 直接暴力求出第k个perfect数字就好. 纯模拟. [代码] #include <bits/stdc++.h> #de ...
- 【Codeforces Round #432 (Div. 1) B】Arpa and a list of numbers
[链接]h在这里写链接 [题意] 定义bad list是一个非空的.最大公约数为1的序列.给定一个序列,有两种操作:花费x将一个元素删除.花费y将一个元素加1,问你将这个序列变为good list所需 ...
- 【Codeforces Round #420 (Div. 2) C】Okabe and Boxes
[题目链接]:http://codeforces.com/contest/821/problem/C [题意] 给你2*n个操作; 包括把1..n中的某一个数压入栈顶,以及把栈顶元素弹出; 保证压入和 ...
- 【Codeforces Round #420 (Div. 2) B】Okabe and Banana Trees
[题目链接]:http://codeforces.com/contest/821/problem/B [题意] 当(x,y)这个坐标中,x和y都为整数的时候; 这个坐标上会有x+y根香蕉; 然后给你一 ...
- 【Codeforces Round #420 (Div. 2) A】Okabe and Future Gadget Laboratory
[题目链接]:http://codeforces.com/contest/821/problem/A [题意] 给你一个n*n的数组; 然后问你,是不是每个位置(x,y); 都能找到一个同一行的元素q ...
- 【Codeforces Round #423 (Div. 2) C】String Reconstruction
[Link]:http://codeforces.com/contest/828/problem/C [Description] 让你猜一个字符串原来是什么; 你知道这个字符串的n个子串; 且知道第i ...
- 【Codeforces Round #423 (Div. 2) B】Black Square
[Link]:http://codeforces.com/contest/828/problem/B [Description] 给你一个n*m的格子; 里面包含B和W两种颜色的格子; 让你在这个格子 ...
随机推荐
- powershell输出错误信息到文件
https://stackoverflow.com/questions/8925323/redirection-of-standard-and-error-output-appending-to-th ...
- win7笔记本设置wifi热点
1.打开cmd 输入netsh wlan set hostednetwork mode=allow ssid=ACE-PC key=12345678 2.等待1-2分钟后,网络连接里会出现一个&quo ...
- 常见的DNS攻击——偷(劫持)、骗(缓存投毒)、打(DDos)
常见的DNS攻击包括: 1) 域名劫持 通过采用黑客手段控制了域名管理密码和域名管理邮箱,然后将该域名的NS纪录指向到黑客可以控制的DNS服务器,然后通过在该DNS服务器上添加相应域名纪录,从而使网民 ...
- django 笔记16 文件上传笔记
views.py文件 def upload_file(request): username = request.POST.get('username') fafafa = request.FILES. ...
- django 笔记5 外键 ForeignKey
class UsserGroup(models.Model): uid = models.AutoField(primary_key=True) caption = models.CharField( ...
- AppManager类,管理Activity和App
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); / ...
- 并查集 (Union Find ) P - The Suspects
Severe acute respiratory syndrome (SARS), an atypical pneumonia of unknown aetiology, was recognized ...
- struts2中标签库访问静态成员
struts2中是可以访问静态成员的,需要以下设置: 1.设置配置文件 struts.xml 中如下: <!-- 设置运行通过ONGL访问静态方法 --> <constant nam ...
- Hope is a good thing, maybe the best of things and no good thing ever dies !
- TP5 模板渲染语法
每次都要去网上找,又发现都不全.所以自己记录一下 volist:循环 {volist name="collection" id="v"} {/volist} i ...