ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1880. Psych Up's Eigenvalues

Crash (access violation) Test #7
Posted by repy 13 Feb 2012 22:49
help please
code:
int main()
{
    int n1,n2,n3,s;
    int k1[1000],k2[1000],k3[1000];
    s=0;
        cin >> n1;
        for (int i=1;i<=n1;i++)
            cin >> k1[i];
        cin >> n2;
        for (int i=1;i<=n2;i++)
            cin >> k2[i];
        cin >> n3;
        for (int i=1;i<=n3;i++)
            cin >> k3[i];

        for (int i=1;i<=n1;i++)
            for (int j=1;j<=n2;j++)
                if (k1[i]==k2[j]) { for (int z=1;z<=n3;z++) {if (k3[z]==k2[j]) {s++; break;} } break;}
        cout << s;
}
Re: Crash (access violation) Test #7
Posted by esger 4 Jun 2012 17:40
The number of eigen values might be up to 4000. So increase your array size from 1000 to 4000.