Run ID 作者 问题 语言 测评结果 分数 时间 内存 代码长度 提交时间
169951 jipm6575lllzich 国王游戏 C++ 解答错误 60 1 MS 268 KB 445 2024-08-20 20:42:32

Tests(6/10):


#include<bits/stdc++.h> using namespace std; struct node{ long long l,r; }a[1001]; bool cmp(node a,node b){ return a.l*a.r<b.l*b.r; } int main(){ int n; cin>>n; for(int i=0;i<=n;i++) cin>>a[i].l>>a[i].r; sort(a+1,a+n+1,cmp); long long p=a[0].l,qw=0; for(int i=1;i<=n;i++){ long long we=p/a[i].r; qw=max(qw,we); p*=a[i].l; } cout<<qw; return 0; }


测评信息: