71282023-12-31 12:01:14KristófHús sütés (75 pont)cpp17Wrong answer 39/7541ms4736 KiB
#include <iostream>

using namespace std;

int main()
{
    int n;
    cin>>n;
    int volgy[n];
    for(int i=0;i<n;i++){
        cin>>volgy[i];
    }

    int nagy=0;
    int nagysz=0;
    int kicsi=10000000;
    int ered=0;

    for(int i=0;i<n;i++){
        if(nagy<volgy[i]){
            nagy=volgy[i];
        }
    }
    for(int i=0;i<n;i++){
        if(volgy[i]<kicsi){
            kicsi=volgy[i];
            if(volgy[i]=nagy){
                nagysz++;
                
            }
        }
    }
    int ans=kicsi+n-1;
    
    if(nagysz==1){
        cout<<nagy;
    }
    else cout<<ans;


    return 0;
}
SubtaskSumTestVerdictTimeMemory
base39/75
1Wrong answer0/03ms1872 KiB
2Accepted0/03ms2124 KiB
3Wrong answer0/019ms2784 KiB
4Accepted3/33ms2644 KiB
5Wrong answer0/33ms2800 KiB
6Accepted3/33ms2788 KiB
7Wrong answer0/33ms2788 KiB
8Accepted4/43ms3040 KiB
9Accepted4/43ms3272 KiB
10Accepted4/43ms3272 KiB
11Accepted4/43ms3268 KiB
12Accepted4/43ms3340 KiB
13Wrong answer0/437ms4352 KiB
14Accepted4/437ms4320 KiB
15Accepted5/537ms4296 KiB
16Wrong answer0/537ms4292 KiB
17Wrong answer0/537ms4292 KiB
18Wrong answer0/437ms4428 KiB
19Wrong answer0/437ms4676 KiB
20Wrong answer0/441ms4632 KiB
21Accepted4/426ms4720 KiB
22Wrong answer0/234ms4736 KiB
23Wrong answer0/218ms4720 KiB