40pts
查看原帖
40pts
1401911
ridewind2013楼主2024/10/10 22:05
#include<bits/stdc++.h>
using namespace std;
int main(){
    int n,t=0,x=0;
    double k=10.0;
    cin>>n;
    while(n--){
        double a;
        int b;
        cin>>a>>b;
        k-=a;
        if(k<=0)break;
        long long ans=1;
        while(1){
            if(b-ans<0){
            	x+=b;
            	break;
            }
            b-=ans;
            t++;
            ans*=2;
        }
    }
    cout<<t<<" "<<x;
    return 0;
}

为什么只有40pts

2024/10/10 22:05
加载中...