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

Help me, please! What is wrong? c++
Posted by Koloskova Mariia 10 Jul 2018 20:15
#include <iostream>
using namespace std;
int main()
{
     int n,m,teacher[1500],student[100000],same=0;
    cin>>n;
    for(int i=0;i<n;i++)
        cin>>teacher[i];
    cin>>m;
    for(int i=0;i<m;i++)
        cin>>student[i];

    for(int i=0;i<n;i++)
        for(int j=0;j<m;j++)
            if(teacher[i]==student[j]) same++;

    cout<<same;
    return 0;
}
Re: Help me, please! What is wrong? c++
Posted by David Espinoza 27 Dec 2018 23:36
Each date is a positive integer not exceeding 10^9, long long int teacher[], student[]