80342024-01-12 11:00:46Leventusz09Hús sütés (75 pont)csharpAccepted 75/75135ms49416 KiB
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Hús_süttés{
    class Program{
        static void Main(){
            int N = int.Parse(Console.ReadLine());
            int[] A = Console.ReadLine().Split().Select(int.Parse).ToArray();

            Array.Sort(A);

            int o1 = 0;
            for(int i=0; i<N; i++){
                if (A[N - i - 1] + i > o1) o1 = A[N - i - 1] + i;
            }
            Console.WriteLine(o1);
        }
    }
}
SubtaskSumTestVerdictTimeMemory
base75/75
1Accepted0/035ms22472 KiB
2Accepted0/034ms22880 KiB
3Accepted0/085ms31956 KiB
4Accepted3/330ms23732 KiB
5Accepted3/334ms23920 KiB
6Accepted3/334ms24320 KiB
7Accepted3/334ms24176 KiB
8Accepted4/434ms24348 KiB
9Accepted4/434ms24852 KiB
10Accepted4/439ms25816 KiB
11Accepted4/439ms25404 KiB
12Accepted4/439ms25724 KiB
13Accepted4/4134ms43228 KiB
14Accepted4/4134ms44124 KiB
15Accepted5/5131ms44856 KiB
16Accepted5/5134ms45404 KiB
17Accepted5/5133ms46168 KiB
18Accepted4/4135ms46516 KiB
19Accepted4/4130ms47612 KiB
20Accepted4/4118ms49416 KiB
21Accepted4/4115ms45544 KiB
22Accepted2/2123ms47680 KiB
23Accepted2/2100ms43192 KiB