답안 #576707

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
576707 2022-06-13T09:51:53 Z ammar124 Exam (eJOI20_exam) C++14
0 / 100
23 ms 1804 KB
#include <bits/stdc++.h>
#define endl '\n'
#define ll long long
using namespace std;
int const maxin = 1e5+6;

int main()
{
    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    int a;
    ll ans = 0;
    ll cnt = -1;
    cin>>a;
    int arr[a];
    int arr2[a];
    for(int i=0;i<a;i++)
        cin>>arr[i];
    for(int i=0;i<a;i++)
        cin>>arr2[i];
    ll x = arr2[0];
    for(int i=0;i<a;i++)
    {
        if(arr[i] == x)
        {
            ans++;
            for(int j=i-1;j>=0;j--)
            {
                if(arr[j] <= x)
                    ans++;
                else
                    break;
            }
            for(int j=i+1;j<a;j++)
            {
                cnt = j;
                if(arr[j] <= x)
                    ans++;
                else
                    break;
            }
            if(cnt != -1)
                i = cnt+1;

        }
    }
    cout<<ans;
    return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Incorrect 0 ms 212 KB Output isn't correct
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 4 ms 776 KB Output is correct
3 Correct 13 ms 1488 KB Output is correct
4 Correct 9 ms 1488 KB Output is correct
5 Correct 23 ms 1804 KB Output is correct
6 Incorrect 10 ms 1492 KB Output isn't correct
7 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 340 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Incorrect 0 ms 212 KB Output isn't correct
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Incorrect 0 ms 212 KB Output isn't correct
4 Halted 0 ms 0 KB -