Submission #953407

# Submission time Handle Problem Language Result Execution time Memory
953407 2024-03-26T00:22:24 Z alo_54 Race (IOI11_race) C++14
0 / 100
1 ms 2396 KB
#include <bits/stdc++.h>
using namespace std;

int best_path(int n, int k, int h[][2], int L[])
{
    int arr[110];

    for (int i = 0; i < n-1; i++)
    {
        arr[h[i][0]] = L[i];
    }

    int minEdges = 1e9;

    for (int i = 0; i < n; i++)
    {
        for (int j = i + 1; j < n; j++)
        {
            int d = 0;

            for (int k = i; k < j; k++)
            {
                d += arr[k];
            }
            
            if (d == k)
            {
                minEdges = min(minEdges, j-i);

                //cout<<minEdges<<endl;
            }
            
        }
        
    }

    return minEdges;

}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 2396 KB Output is correct
2 Correct 1 ms 2396 KB Output is correct
3 Incorrect 1 ms 2392 KB Output isn't correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 2396 KB Output is correct
2 Correct 1 ms 2396 KB Output is correct
3 Incorrect 1 ms 2392 KB Output isn't correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 2396 KB Output is correct
2 Correct 1 ms 2396 KB Output is correct
3 Incorrect 1 ms 2392 KB Output isn't correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 2396 KB Output is correct
2 Correct 1 ms 2396 KB Output is correct
3 Incorrect 1 ms 2392 KB Output isn't correct
4 Halted 0 ms 0 KB -