社区讨论
帮我看看哪里错了,悬赏2关
P1193洛谷团队训练 VS 传统团队训练参与者 1已保存回复 0
讨论操作
快速查看讨论及其快照的属性,并进行相关操作。
- 当前回复
- 0 条
- 当前快照
- 1 份
- 快照标识符
- @lo1cu126
- 此快照首次捕获于
- 2023/10/22 18:57 2 年前
- 此快照最后确认于
- 2023/11/02 19:23 2 年前
CPP
#include<bits/stdc++.h>
using namespace std;
map<int,int> ii1,ii2;
long long maxx[1005][1005],sum[1005][1005];
int p[1005],s[1005];
int main(){
int n,m;
cin>>n>>m;
for(int i=1;i<=n;i++){
scanf("%d",&p[i]);
ii1[p[i]]=i;
}
for(int i=1;i<=m;i++){
scanf("%d",&s[i]);
ii2[s[i]]=i;
}
long long a,b,c,d,aa,h,e,r;
scanf("%lld%lld%lld%lld%lld%lld%lld%lld",&a,&b,&c,&d,&aa,&h,&e,&r);
long long ans1=m*a,ans2=0;
for(int i=1;i<=r;i++){
int x,y,z;
scanf("%d%d%d",&x,&y,&z);
x=ii1[x];
y=ii2[y];
if(maxx[x][y]<z&&e==1)ans1+=d,maxx[x][y]=z;
sum[x][y]++;
// cout<<x<<' '<<y<<' '<<sum[x][y]<<endl;
}
for(long long i=1,x,y;i<=m;i++){
for(int j=1;j<=n;j++){
// cout<<i<<' '<<j<<' '<<sum[j][i]<<endl;
x=0,y=a;
x=b*sum[j][i];
y+=c*sum[j][i];
ans1+=min(x,y);
}
}
ans2=(n*a+c*r)*100/aa+h;
cout<<ans1<<endl<<ans2<<endl;
if(ans1>ans2)cout<<"Use Luogu!";
else cout<<"Forget it...";
return 0;
}
回复
共 0 条回复,欢迎继续交流。
正在加载回复...