程序一致,输入一致,输出不一样,有没有大佬解答一下。
本地:
IDE:
好像之前就遇到过一次,但是当时忘了咋解决的了。 代码:
#include <iostream>
using namespace std;
int main ()
{
long int ct=0,lg=0;
long int N,M,i,j,ta,tb,tc,td,A,H,E,R,max1=0,max2=0;
cin>>N>>M;
long int p[N],s[M];
for (i=1;i<=N;i++)
{
cin>>p[i];
if (max1<p[i])
max1=p[i];
}
for (i=1;i<=M;i++)
{
cin>>s[i];
if (max2<s[i])
max2=s[i];
}
cin>>ta>>tb>>tc>>td>>A>>H>>E;
cin>>R;
long int p1[R],s1[R],s2[R],map[max1+1][max2+1]={0};
for (i=1;i<=R;i++)
{
cin>>p1[i]>>s1[i]>>s2[i];
map[p1[i]][s1[i]]++;
}
for (i=1;i<=N;i++)
{
for (j=1;j<=M;j++)
{
if (map[p[i]][s[j]]*tb>(map[p[i]][s[j]]*tc+ta))
ct=ct+(map[p[i]][s[j]]*tc+ta);
else
ct=ct+map[p[i]][s[j]]*tb;
}
}
ct=ct+ta*N;
if (E==1)
{
}
lg=(ta*N+R*tc)*100/A+H;
cout<<ct<<endl<<lg<<endl;
if (lg<ct)
{
cout<<"Use Luogu!";
}
else
{
cout<<"Forget it...";
}
return 0;
}```