Submission #1081996

# Submission time Handle Problem Language Result Execution time Memory
1081996 2024-08-30T14:07:22 Z LaMatematica14 Longest Trip (IOI23_longesttrip) C++17
5 / 100
7 ms 344 KB
#include <bits/stdc++.h>
using namespace std;
bool are_connected(vector<int> A, vector<int> B);

vector<int> longest_trip(int N, int D){
    vector<int> perc = {0};
    for (int i = 1; i < N-1; i++) {
        vector<int> ca = {i}, cb = {perc.back()};
        if (are_connected(ca, cb)) perc.push_back(i);
        else {
            perc.push_back(i+1); perc.push_back(i);
        }
    }
    vector<int> a = {N-1}, b = {perc.back()};
    if (are_connected(a, b)) perc.push_back(N-1);
    else {
        perc.insert(perc.begin(), N-1);
    }
    return perc;
}


# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 344 KB Incorrect
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 5 ms 344 KB Output is correct
2 Correct 5 ms 344 KB Output is correct
3 Correct 5 ms 344 KB Output is correct
4 Correct 5 ms 344 KB Output is correct
5 Correct 5 ms 344 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 7 ms 344 KB Output is correct
2 Correct 6 ms 344 KB Output is correct
3 Correct 6 ms 344 KB Output is correct
4 Correct 4 ms 340 KB Output is correct
5 Correct 4 ms 344 KB Output is correct
6 Incorrect 1 ms 344 KB Incorrect
7 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 5 ms 344 KB Output is correct
2 Correct 5 ms 344 KB Output is correct
3 Correct 7 ms 344 KB Output is correct
4 Correct 4 ms 344 KB Output is correct
5 Correct 6 ms 344 KB Output is correct
6 Incorrect 1 ms 344 KB Incorrect
7 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 5 ms 344 KB Output is correct
2 Correct 5 ms 344 KB Output is correct
3 Correct 5 ms 344 KB Output is correct
4 Correct 5 ms 344 KB Output is correct
5 Correct 6 ms 344 KB Output is correct
6 Incorrect 1 ms 344 KB Incorrect
7 Halted 0 ms 0 KB -