40分求调!!
感谢大佬!!!
%%%!!!
#include<iostream>
using namespace std;
int n;
int deng,jing;
double xie = 10;
int main(){
cin >> n;
int t = 0;
for(int i = 1;i <= n;i++){
double x;
int j;
cin >> x >> j;
if(xie - x <= 0){
cout << deng <<' '<< jing;
return 0;
}else{
xie -= x;
if(x > 10) x = 10;
}
j += jing;
while(j - (1 << t) >= 0){
deng++;
j -= (1 << t);
t++;
}
jing += j;
}
cout << deng <<' ' << jing;
return 0;
}