Nie no luz, błąd najprawdopodobniej jest u mnie, z tym, że nie mogę namierzyć co go wywala.
Kod jest jak poniżej:
#include <iostream>
#include <vector>
#include <string>
#include <cstdlib>
#include <algorithm>
using namespace std;
int main()
{
try
{
int n;
cin>>n;
//if(n>=301) cin>>n;
//else
//{
int m;
vector <vector <string> >typy;
vector <string>gole;
for(int i=0; i<n; i++)
{
cin>>m;
//if(m>=501) cin>>m;
//else
//{
for(int j=0; j<m; j++,cout<<endl)
{
vector <string> czyt;
cin.sync();
string linia;
getline(cin,linia);
czyt.push_back(linia.substr(0,linia.find(' ')));
czyt.push_back(linia.substr(linia.find('-')+2,linia.find_last_of(' ')-(linia.find('-')+2)));
czyt.push_back(linia.substr(linia.rfind(' ')+1,2));
typy.push_back(czyt);
}
int q;
cin>>q;
//if(q>=1001) cin>>q;
//else
for(int j=0; j<q; j++)
{
cin.sync();
string linia;
getline(cin,linia);
gole.push_back(linia);
}
// }
int traf=0;
for(int i=0; i<typy.size(); i++)
{
bool host=false, guest=false, tie=false, typhost=false, typguest=false, typtie=false;
if(count(gole.begin(),gole.end(),typy[i][0])>count(gole.begin(),gole.end(),typy[i][1]))
host=true;
else if(count(gole.begin(),gole.end(),typy[i][0])<count(gole.begin(),gole.end(),typy[i][1]))
guest=true;
else
tie=true;
if(typy[i][2]=="1") typhost=true;
else if(typy[i][2]=="0") typtie=true;
else if(typy[i][2]=="2") typguest=true;
else if(typy[i][2]=="10")
{
typhost=true;
typtie=true;
}
else if(typy[i][2]=="02")
{
typtie=true;
typguest=true;
}
else if(typy[i][2]=="12")
{
typhost=true;
typguest=true;
}
if((typhost&&host)||(typtie&&tie)||(typguest&&guest))
traf++;
}// koniec if dla n
if(traf==m)
cout<<"TAK"<<endl;
else
cout<<"NIE "<<traf<<"/"<<m<<endl;
typy.clear();
gole.clear();
traf=0;
}
//}
}
catch(const std::exception & x)
{
std::cout << x.what();
}
return 0;
}
będę wdzięczny za jakiekolwiek podpowiedzi.