74952024-01-09 10:53:02almadavKártyajátékcpp17Time limit exceeded 1/30500ms5040 KiB
#include <bits/stdc++.h>

using namespace std;

int main()
{
    iostream::sync_with_stdio(0);
    cin.tie(0);
    unsigned long long n,k;
    int pont =0;
    cin >> n;
    cin >> k;
    bool nem;
    vector<unsigned long long> alma;
    unsigned long long current;
    for(int i =0; i<k;i++)
    {
        cin >> current; alma.push_back(current);
    }
    for(int i =0; i<k-1;i++)
    {
        nem = true;
        current = alma[i];
        //if(current == n+1) continue;
        for(int j = i+1 ; j < k; j++)
        {
            //cout << "almaj:" << alma[j] << " current:" << current<<endl;
            if(alma[j] < current)
            {
                if(nem)pont++;
                nem = false;
                //cout << "almaj" << alma[j] << " current:"<<current<<endl;
                alma.erase(alma.begin()+j-1);
                k--;

            }
        }
    }
    cout << pont;
}
SubtaskSumTestVerdictTimeMemory
base1/30
1Accepted0/03ms1860 KiB
2Time limit exceeded0/0500ms2500 KiB
3Accepted1/13ms2340 KiB
4Wrong answer0/12ms2420 KiB
5Wrong answer0/13ms2652 KiB
6Wrong answer0/23ms2652 KiB
7Wrong answer0/23ms2912 KiB
8Wrong answer0/23ms2868 KiB
9Wrong answer0/1224ms5040 KiB
10Time limit exceeded0/2430ms3600 KiB
11Time limit exceeded0/3441ms3768 KiB
12Time limit exceeded0/3469ms3568 KiB
13Time limit exceeded0/1446ms3588 KiB
14Time limit exceeded0/2449ms3584 KiB
15Time limit exceeded0/3446ms3708 KiB
16Time limit exceeded0/3455ms3788 KiB
17Time limit exceeded0/3453ms3852 KiB