답안 #576576

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
576576 2022-06-13T08:08:37 Z Yazan_SA Exam (eJOI20_exam) C++14
0 / 100
20 ms 356 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[5000], arrb[5000];
        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++)
        {
            for(int j=0; j<n; j++)
            {
                if(i==j)
                    continue;
                if(arrb[i]==arr[j] && arr[i]<arrb[i] || arr[i]==arrb[i])
                {
                    ans++;
                    break;
                }
            }
        }
        cout<<ans;
    }
}

Compilation message

exam.cpp: In function 'int main()':
exam.cpp:26:36: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
   26 |                 if(arrb[i]==arr[j] && arr[i]<arrb[i] || arr[i]==arrb[i])
      |                    ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 340 KB Output is correct
2 Correct 1 ms 340 KB Output is correct
3 Correct 1 ms 340 KB Output is correct
4 Correct 1 ms 340 KB Output is correct
5 Incorrect 1 ms 356 KB Output isn't correct
6 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 284 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 340 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 20 ms 340 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 340 KB Output is correct
2 Correct 1 ms 340 KB Output is correct
3 Correct 1 ms 340 KB Output is correct
4 Correct 1 ms 340 KB Output is correct
5 Incorrect 1 ms 356 KB Output isn't correct
6 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 340 KB Output is correct
2 Correct 1 ms 340 KB Output is correct
3 Correct 1 ms 340 KB Output is correct
4 Correct 1 ms 340 KB Output is correct
5 Incorrect 1 ms 356 KB Output isn't correct
6 Halted 0 ms 0 KB -