59972023-10-14 20:54:05eokorVállalkozócpp11Wrong answer 30/40200ms4268 KiB
#include <bits/stdc++.h>

using namespace std;

int main()
{
    int n,m;
    cin>>n>>m;
    vector  <int> hatarido;
    int x;
    for(int i=1;i<=n;i++)
        {
            cin>>x;
            hatarido.push_back(x);
        }

    int teljesitett=0;

    for(int i=1;i<=m;i++)
    {
        cin>>x;
        for(int i=x-1;i>=0;i--)
        {
            if(hatarido[i]!=0)
            {
                teljesitett++;
                hatarido[i]--;
            }
        }
    }
    cout<<teljesitett;
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base30/40
1Accepted0/03ms1808 KiB
2Accepted0/075ms2028 KiB
3Accepted2/23ms2244 KiB
4Accepted2/23ms2488 KiB
5Accepted2/23ms2596 KiB
6Wrong answer0/24ms2804 KiB
7Wrong answer0/26ms3168 KiB
8Accepted2/23ms3068 KiB
9Accepted2/24ms3272 KiB
10Accepted2/23ms3484 KiB
11Accepted2/24ms3704 KiB
12Accepted2/24ms3676 KiB
13Accepted2/24ms3808 KiB
14Accepted2/24ms3816 KiB
15Accepted2/213ms3812 KiB
16Accepted2/214ms3836 KiB
17Time limit exceeded0/2200ms3988 KiB
18Time limit exceeded0/2172ms3444 KiB
19Time limit exceeded0/2170ms4268 KiB
20Accepted2/239ms4212 KiB
21Accepted2/254ms4256 KiB
22Accepted2/275ms4152 KiB