답안 #576608

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
576608 2022-06-13T08:35:01 Z Yazan_SA Exam (eJOI20_exam) C++14
컴파일 오류
0 ms 0 KB
#include<bits/stdc++.h>
#define ll long long
#define endl "\n"
#define start cin.tie(0); cout.tie(0); ios_base::sync_with_stdio(0);
using namespace std;

int main()
{
    start
    //freopen("survive.in", "r", stdin);
    int t=1;
    //cin>>t;
    while(t--)
    {
        int n, arr[100000], arrb[100000];
        cin>>n;
        int ans=0;
        for(int i=0; i<n; cin>>arr[i++]);
        for(int i=0; i<n; cin>>arrb[i++]);
        for(int i=0; i<n; i++)
        {
            int mn=1e9+1;
            bool is=1;
            if(arr[i]>arrb[i])
                break;
            if(arr[i]==arrb[i])
            {
                ans++;
                is=0;
            }
            mn=1e9;
            for(int i=0; i<n; i++)
            {
                if(i==j)
                continue;
                if(arr[j]==arrb[i])
                    ans++;
            }
        }
        cout<<ans;
    }
}

Compilation message

exam.cpp: In function 'int main()':
exam.cpp:34:23: error: 'j' was not declared in this scope
   34 |                 if(i==j)
      |                       ^
exam.cpp:36:24: error: 'j' was not declared in this scope
   36 |                 if(arr[j]==arrb[i])
      |                        ^