30842023-02-14 20:38:44baranyimarcellHús sütés (75 pont)cpp11Time limit exceeded 19/75444ms12540 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/04ms9532 KiB
2Accepted0/04ms9744 KiB
3Time limit exceeded0/0400ms5864 KiB
4Accepted3/36ms10208 KiB
5Accepted3/34ms10424 KiB
6Accepted3/34ms10704 KiB
7Wrong answer0/36ms10844 KiB
8Wrong answer0/44ms11144 KiB
9Wrong answer0/44ms11092 KiB
10Wrong answer0/46ms11196 KiB
11Wrong answer0/47ms11340 KiB
12Wrong answer0/46ms11472 KiB
13Time limit exceeded0/4365ms7556 KiB
14Time limit exceeded0/4356ms7452 KiB
15Time limit exceeded0/5352ms7376 KiB
16Time limit exceeded0/5368ms7780 KiB
17Time limit exceeded0/5368ms7968 KiB
18Time limit exceeded0/4444ms7932 KiB
19Time limit exceeded0/4367ms7940 KiB
20Accepted4/443ms12488 KiB
21Accepted4/4172ms12492 KiB
22Time limit exceeded0/2370ms7760 KiB
23Accepted2/221ms12540 KiB