求助
  • 板块灌水区
  • 楼主liaodong0812
  • 当前回复3
  • 已保存回复3
  • 发布时间2021/12/10 23:43
  • 上次更新2023/11/3 22:32:42
查看原帖
求助
406201
liaodong0812楼主2021/12/10 23:43
#include<cstdio>
#include<iostream>
#define NN 10000
using namespace std; 
struct node{
	int diren,youren;
}a[NN];
int n,x,s,ss,t;
int cnt,ans,d;
int main(){
	scanf("%d",&n);
	scanf("%d",&x);
	scanf("%d%d%d",&s,&ss,&t);
	for(int i=1;i<=n;i++){
	    scanf("%d%d",a[i].youren ,a[i].diren );	
	    cnt+=a[i].youren*(x-1) ;
	    d+=a[i].diren ;
	}
	cout<<cnt<<" "<<d;
int yfsum=s/ss*x;
	if(yfsum+cnt<d){
		cout<<"0";
		return 0;
	}
	else{
		cout<<"1";
		ans=yfsum*t+cnt*t;
		cout<<ans;
	}
	return 0;
}

运行输入没输完就结束了,这代码我随便编的,练练手,求大佬解惑

2021/12/10 23:43
加载中...