95042024-02-22 12:34:34Leventusz09Vásárlás (75 pont)csharpTime limit exceeded 15/75451ms29808 KiB
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Vásárlás{
    class Program{
        static void Main(){
            int N = int.Parse(Console.ReadLine());
            int[] A = Console.ReadLine().Split().Select(int.Parse).ToArray(),
                  B = Console.ReadLine().Split().Select(int.Parse).ToArray(),
                  O = new int[N];
            

            for(int i=0; i<N; i++){
                O[i] = A[i] - B[i];
                //if(A[i])
            }

            int o1 = int.MaxValue;

            for(int i=-1, to, j, k; i<N; i++){
                for(j=-1; j<N; j++){
                    to = 0;
                    for(k=0; k<N; k++){
                        if (i <= k && k <= j) to += A[k];
                        else to += B[k];
                    }
                    if (to < o1) o1 = to;
                }
            }
            Console.WriteLine(o1);
        }
    }
}
SubtaskSumTestVerdictTimeMemory
base15/75
1Accepted0/030ms21700 KiB
2Time limit exceeded0/0363ms12024 KiB
3Accepted3/330ms23120 KiB
4Accepted4/432ms23388 KiB
5Accepted4/434ms23784 KiB
6Accepted4/432ms23812 KiB
7Time limit exceeded0/4449ms6156 KiB
8Time limit exceeded0/3388ms6352 KiB
9Time limit exceeded0/4451ms6696 KiB
10Time limit exceeded0/4379ms6612 KiB
11Time limit exceeded0/4375ms6536 KiB
12Time limit exceeded0/5400ms6528 KiB
13Time limit exceeded0/3367ms23920 KiB
14Time limit exceeded0/3372ms25504 KiB
15Time limit exceeded0/3377ms26600 KiB
16Time limit exceeded0/3444ms27964 KiB
17Time limit exceeded0/3370ms28672 KiB
18Time limit exceeded0/3375ms28800 KiB
19Time limit exceeded0/3386ms28316 KiB
20Time limit exceeded0/3382ms28716 KiB
21Time limit exceeded0/3377ms29356 KiB
22Time limit exceeded0/3388ms27616 KiB
23Time limit exceeded0/3372ms29808 KiB
24Time limit exceeded0/3379ms29756 KiB