30852023-02-14 20:39:42baranyimarcellHús sütés (75 pont)cpp17Time limit exceeded 19/75448ms12632 KiB
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

int main()
{
    int N, i, j;
    cin>>N;
    int hus[N];
    vector<int> db;
    db.resize(1000000);
    vector<int> kulonb;
    int mx=0;
    for (i=0; i<N; i++)
    {
        cin>>hus[i];
        db[hus[i]]+=1;
        if (count(kulonb.begin(), kulonb.end(), hus[i])==false)
        {
            kulonb.push_back(hus[i]);
        }
        if (hus[i]>mx) mx=hus[i];
    }
    //cout<<mx<<endl;
    int ki=0;
    for (i=0; i<kulonb.size(); i++)
    {
        ki+=db[kulonb[i]
        ]-1;
    }
    cout<<ki+mx<<endl;
}
SubtaskSumTestVerdictTimeMemory
base19/75
1Accepted0/04ms9568 KiB
2Accepted0/06ms9744 KiB
3Time limit exceeded0/0400ms5872 KiB
4Accepted3/36ms10168 KiB
5Accepted3/36ms10128 KiB
6Accepted3/34ms10380 KiB
7Wrong answer0/36ms10672 KiB
8Wrong answer0/44ms10880 KiB
9Wrong answer0/44ms11020 KiB
10Wrong answer0/46ms10976 KiB
11Wrong answer0/47ms10972 KiB
12Wrong answer0/47ms11256 KiB
13Time limit exceeded0/4400ms7292 KiB
14Time limit exceeded0/4448ms7596 KiB
15Time limit exceeded0/5439ms7592 KiB
16Time limit exceeded0/5372ms7908 KiB
17Time limit exceeded0/5361ms7844 KiB
18Time limit exceeded0/4351ms7852 KiB
19Time limit exceeded0/4368ms8128 KiB
20Accepted4/443ms12348 KiB
21Accepted4/4122ms12632 KiB
22Time limit exceeded0/2363ms7880 KiB
23Accepted2/223ms12488 KiB