样例:
4 4
501 502 503 504
2 3 5 7
50 30 10 5 93 50 1
10
501 2 10
501 2 80//好像从这里输入不了了
501 2 70
502 3 0
502 3 0
504 5 100
503 7 0
503 7 0
503 7 0
503 7 10
输出
480
372
Use Luogu!
#include<bits/stdc++.h>
using namespace std;
int n,m,ta,tb,tc,td,A,H,E,r;
int p[1024],s[1024],score[1024][1024],judge[1024][1024];//评测次数
int teacher,stu;
int pr,sr,sc,luogu,tra;
int main(){
cin>>n>>m;
for(int i=1;i<=n;i++){
cin>>p[i];
}
for(int i=1;i<=m;i++){
cin>>s[i];
}
sort(p+1,p+n+1);
sort(s+1,s+n+1);
cin>>ta>>tb>>tc>>A>>H>>E;
cin>>r;
tra=ta*n;
for(int i=1;i<=r;i++){
cin>>pr>>sr>>sc;
pr=lower_bound(p+1,p+n+1,pr)-p;
sr=lower_bound(s+1,s+n+1,sr)-p;
if(sc>score[sr][pr]&&E==1){//excel更改
tra+=td;
score[sr][pr]=sc;
}
judge[sr][pr]++;
}
luogu=(n*ta+r*tc)*100/A+H;
for(int i=1;i<=m;i++){
for(int j=1;j<=n;j++){
teacher=0,stu=ta;
teacher+=tb*judge[i][j];
stu+=tc*judge[i][j];
tra+=min(teacher,stu);
}
}
cout<<tra<<endl<<luogu<<endl;
if(luogu<tra){
cout<<"Use Luogu!";
}
else
cout<<"Forget it...";
return 0;
}