acm HDU 1084 报错为Runtime Error(ACCESS_VIOLATION)
acm HDU 1084 报错为Runtime Error(ACCESS_VIOLATION)
#include
#include
#include
#include
#define N 100+10
using namespace std;
struct student
{
int slove;
string time;
int idx;
int score;
};
struct student a[N];
bool cmp1(student a,student b)
{
if (a.slove = b.slove)
return a.slove > b.slove;
else
a.time < b.time;
}
bool cmp2(student a,student b)
{
return a.idx < b.idx;
}
int main()
{
int n,i,slovenum[6];
int p1 = 0,p2 = 0,p3 = 0,p4 = 0;
while (cin>> n&&n = -1)
{
memset(slovenum,0,sizeof(slovenum));
for (i = 0;i < n;i++)
{
cin >> a[i].slove >> a[i].time;
a[i].idx = i + 1;
slovenum[a[i].slove]++;
}
sort(a,a + n,cmp1);
for (i = 0;i