71252023-12-31 11:57:05KristófHús sütés (75 pont)cpp17Wrong answer 15/7541ms5252 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++;
            }
        }
    }
    if(nagysz=1){
        cout<<nagy;
    }
    else cout<<kicsi+n-1;


    return 0;
}
SubtaskSumTestVerdictTimeMemory
base15/75
1Accepted0/03ms1812 KiB
2Wrong answer0/03ms1920 KiB
3Accepted0/019ms2324 KiB
4Accepted3/33ms2132 KiB
5Wrong answer0/33ms2336 KiB
6Wrong answer0/33ms2544 KiB
7Wrong answer0/33ms2756 KiB
8Wrong answer0/43ms3008 KiB
9Wrong answer0/43ms3176 KiB
10Wrong answer0/43ms3288 KiB
11Wrong answer0/43ms3260 KiB
12Wrong answer0/43ms3540 KiB
13Accepted4/437ms4312 KiB
14Wrong answer0/437ms4392 KiB
15Wrong answer0/537ms4520 KiB
16Wrong answer0/537ms4728 KiB
17Wrong answer0/537ms4796 KiB
18Accepted4/437ms4796 KiB
19Accepted4/437ms5052 KiB
20Wrong answer0/441ms4880 KiB
21Wrong answer0/427ms5116 KiB
22Wrong answer0/235ms5232 KiB
23Wrong answer0/219ms5252 KiB