Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
Register

## 虽然代码比较烂，可是看不出为啥错额，附代码，求各位帮忙看看！

Posted by jiayiyang123 at 2014-03-11 14:55:10 on Problem 2664
```#include<iostream>
#include<vector>

using namespace std;
struct categories
{
int num;
int leastnum;
vector<string> courseid;
};
int main()
{
int k,i;
cin>>k;
vector<string> courseselected;
while(k!=0)
{
int m;

cin>>m;
categories *cate=new categories[m];
for(i=0;i<k;i++)
{
string a;
cin>>a;
courseselected.push_back(a);
}
// int flagno=0;
int flag=0;
for(i=0;i<m;i++)
{

cin>>cate[i].num>>cate[i].leastnum;
for(int j=0;j<cate[i].num;j++)
{
string id;
cin>>id;
cate[i].courseid.push_back(id);
}
int count=0;
for(int j=0;j<courseselected.size();j++)
{
for(int k=0;k<cate[i].courseid.size();k++)
{
if(courseselected[j]==cate[i].courseid[k])
{
count++;
}
}
}
if(count<cate[i].leastnum)
{
flag=1;
}

}
if(flag==1)
cout<<"no"<<endl;
else
cout<<"yes"<<endl;
cin>>k;
}
return 0;
}
```

Followed by: