社区讨论
扣95pts
B4450[GESP202512 三级] 小杨的智慧购物参与者 3已保存回复 3
讨论操作
快速查看讨论及其快照的属性,并进行相关操作。
- 当前回复
- 3 条
- 当前快照
- 1 份
- 快照标识符
- @mm8qq94h
- 此快照首次捕获于
- 2026/03/02 13:30 6 天前
- 此快照最后确认于
- 2026/03/05 13:05 3 天前
我一个代码95pts,
这一个代码5pts,
融合一下变成Compile Error。
离谱。
CPP这一个代码5pts,
融合一下变成Compile Error。
离谱。
#include <bits/stdc++.h>
using namespace std;
int n,i,j,m,s,w,t,z;
struct q
{
int k;//种类
int p;//价格
};
struct q h[100050];
int main(){
// freopen("2.in","r",stdin);
// freopen("2.out","w",stdout);
cin>>m>>n;
for(i=1;i<=n;i++){
cin>>s>>w;
h[i].k=s;
h[i].p=w;
}
for(i=1;i<=m;i++){
for(j=1;j<=n;j++){
t=2000;
if(h[j].k==i){
t=min(t,h[i].p);
}
}
z+=t;
}
cout<<z<<endl;
return 0;
}
回复
共 3 条回复,欢迎继续交流。
正在加载回复...