前5点WA后5点RE
#include <iostream>
#include <map>
using namespace std;
int main(){
int n,m,p[1001]={},s[1001]={},Ta,Tb,Tc,Td,A,H,E,r,Pr,Sr,Sc,mark[1001]={};
map<pair<int,int>,int> record;
int cena=0,luogu=0;
cin>>n>>m;
for(int i=1;i<=n;i++){
cin>>p[i];
}
for(int i=1;i<=m;i++){
cin>>s[i];
}
cin>>Ta>>Tb>>Tc>>Td>>A>>H>>E;
for(int i=1;i<=n;i++){
for(int j=1;j<=m;j++){
record[make_pair(p[i],s[j])]=0; // make test history
}
}
cin>>r;
cena+=Ta*n; //cena's init load data time
luogu+=Ta*n+Tc*r; //luogu's all time
#ifndef ONLINE_JUDGE
cout<<cena<<endl;
#endif
for(int i=1;i<=r;i++){
cin>>Pr>>Sr>>Sc;
if(E&&record[make_pair(Pr,Sr)]<Sc) record[make_pair(Pr,Sr)]=Sc,cena+=Td; //if have excel:record it
mark[Sr]++;
#ifndef ONLINE_JUDGE
if(E) cout<<cena<<endl;
#endif
}
for(int i=1;i<=m;i++){
if(mark[s[i]]*Tb>mark[s[i]]*Tc+Ta) cena+=(mark[s[i]]*Tc+Ta); //use cena on the teacher machine else cena+=mark[s[i]]*Tb; //use cena on owner's machine
#ifndef ONLINE_JUDGE
cout<<cena<<endl; //Trabish CENA!
#endif
}
luogu=luogu*100/A+H; // luogu's wenduxing and forbidden time
cout<<cena<<endl<<luogu<<endl;
if(luogu<cena) cout<<"Use Luogu!"<<endl;
else cout<<"Forget it..."<<endl;
return 0;
}