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 1196. History Exam

wrong answer, please help
Posted by TyumenIU_ubiyzza 18 Feb 2022 18:52
what are mistakes in this code?
#include <iostream>
using namespace std;
long long int a[15000];
long long int b[1000000];
int main()
{
    int c, f, d, e, g,l;
    l = 0;
    cin >> c;
    for (f = 0; f != c; f++)
    {
        cin >> a[f];
    }
    cin >> d;
    for (e = 0; e != d; e++)
    {
        cin >> b[e];
    }
    for (e = 0; e != d; e++)
    {
        g = b[e];
        for (f = 0; f != c; f++)
        {
            if (g == a[f])
            {
                l = l++;
                break;
            }

        }
    }
    cout << l << endl;
    system("pause");
    return 0;
}

Edited by author 18.02.2022 18:53