Submission #465256

# Submission time Handle Problem Language Result Execution time Memory
465256 2021-08-15T12:34:19 Z CyberCow Exam (eJOI20_exam) C++17
12 / 100
29 ms 3072 KB
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <set>
#include <string>
#include <cmath>
#include <map>
#include <unordered_map>
#include <fstream>
#include <iomanip>
#include <iterator>
#include <stack>
using namespace std;
using ll = long long;
const int maxn = 100005;
int a[maxn];
int b[maxn];
bool stug[maxn];
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    int n, i, j;
    cin >> n;
    for ( i = 0; i < n; i++)
    {
        cin >> a[i];
    }
    for (i = 0; i < n; i++)
    {
        cin >> b[i];
    }
    if(1)
    {
        for ( i = 0; i < n; i++)
        {
            if (a[i] == b[0])
            {
                j = i - 1;
                while (j >= 0 && a[j] != b[0] && a[j] <= b[0])
                {
                    a[j] = b[0];
                    j--;
                }
                j = i + 1;
                while (j < n && a[j] != b[0] && a[j] <= b[0])
                {
                    a[j] = b[0];
                    j++;
                }
            }
        }
        int ans = 0;
        for ( i = 0; i < n; i++)
        {
            if (a[i] == b[0])
                ans++;
        }
        cout << ans;
    }
    return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Incorrect 0 ms 204 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 332 KB Output is correct
2 Correct 6 ms 844 KB Output is correct
3 Correct 20 ms 2000 KB Output is correct
4 Correct 15 ms 1412 KB Output is correct
5 Correct 29 ms 3072 KB Output is correct
6 Correct 16 ms 1460 KB Output is correct
7 Correct 16 ms 1612 KB Output is correct
8 Correct 28 ms 3036 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 332 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 460 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Incorrect 0 ms 204 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Incorrect 0 ms 204 KB Output isn't correct
3 Halted 0 ms 0 KB -