不是,第三个测试点咋过不了
查看原帖
不是,第三个测试点咋过不了
1559448
DKCZG楼主2024/12/10 22:29

见标题

其他测试点都过了,就是第三个测试点过不了,下载了一下数据,经验等级对了,但剩下的经验点怎么就差了3?! 是我漏掉了什么吗?有没有大佬能解答一下??

#include<cstdio>
#include<cmath>
int main(){
	long long n,L=0,xp=0,mm;
	double k,x=10.0;
	scanf("%lld",&n);
	for(long long i=0;i<n;i++){
		scanf("%lf %lld",&k,&mm);
		x-=k;
		if(x<=0)continue;
		xp+=mm;
		if(x>10)x=10;
	}
	while(xp>=pow(2,L)){
		xp-=pow(2,L);
		L++;
	}
	printf("%lld %lld",L,xp);
	return 0;
}
2024/12/10 22:29
加载中...