60052023-10-17 19:01:55gittyVállalkozócpp17Time limit exceeded 34/40200ms4108 KiB
#include <iostream>
#include <stdlib.h>
#include <fstream>
#include <vector>
using namespace std;
int main() {

       // ifstream f("be");
        int days, orders;
        int dlim[10001];
      //  vector<int> dlim;
        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[i]) {
                    dlim[i]--;
                    max++;
                    break;
                }
            }*/
            int j = temp;
            while(j!=0)
            {
                if(dlim[j])
                {
                    dlim[j]--;
                    max++;
                    break;
                }
                j--;
            }
        }
        cout<<max;

}
SubtaskSumTestVerdictTimeMemory
base34/40
1Accepted0/03ms1912 KiB
2Accepted0/067ms2248 KiB
3Accepted2/23ms2456 KiB
4Accepted2/22ms2636 KiB
5Accepted2/23ms2908 KiB
6Accepted2/23ms2772 KiB
7Accepted2/24ms3028 KiB
8Accepted2/23ms3100 KiB
9Accepted2/24ms3440 KiB
10Accepted2/23ms3776 KiB
11Accepted2/24ms3616 KiB
12Accepted2/24ms3604 KiB
13Accepted2/24ms3864 KiB
14Accepted2/24ms3820 KiB
15Accepted2/212ms3816 KiB
16Accepted2/213ms3820 KiB
17Time limit exceeded0/2200ms3916 KiB
18Time limit exceeded0/2158ms4028 KiB
19Time limit exceeded0/2157ms4000 KiB
20Accepted2/232ms4032 KiB
21Accepted2/246ms4108 KiB
22Accepted2/264ms4028 KiB