60042023-10-17 18:42:48gittyVállalkozócpp17Time limit exceeded 34/40170ms4492 KiB
#include <iostream>
#include <stdlib.h>
#include <fstream>

using namespace std;
int main() {

       // ifstream f("be");
        int days, orders;
        int dlim[10001];

        cin>>days>>orders;

        int temp, max=0;
        for(int i = 1; i<=days; i++)
        {
            cin>>temp;
            dlim[i] = temp;


        }
        for(int i = 1; i<=orders; i++)
        {
            cin>>temp;
            for(int j = temp; j>=1; j--) {
                if (dlim[j]) {
                    dlim[j]--;
                    max += 1;

                    break;
                }
            }
        }
        cout<<max;

}
SubtaskSumTestVerdictTimeMemory
base34/40
1Accepted0/03ms1916 KiB
2Accepted0/064ms2120 KiB
3Accepted2/23ms2460 KiB
4Accepted2/23ms2672 KiB
5Accepted2/23ms2884 KiB
6Accepted2/23ms2836 KiB
7Accepted2/24ms2968 KiB
8Accepted2/23ms3176 KiB
9Accepted2/24ms3520 KiB
10Accepted2/23ms3476 KiB
11Accepted2/24ms3476 KiB
12Accepted2/24ms3476 KiB
13Accepted2/24ms3696 KiB
14Accepted2/24ms3688 KiB
15Accepted2/212ms3820 KiB
16Accepted2/213ms4044 KiB
17Time limit exceeded0/2170ms3296 KiB
18Time limit exceeded0/2158ms4404 KiB
19Time limit exceeded0/2159ms4492 KiB
20Accepted2/232ms4420 KiB
21Accepted2/246ms4372 KiB
22Accepted2/264ms4372 KiB