Submission #993200

# Submission time Handle Problem Language Result Execution time Memory
993200 2024-06-05T12:36:27 Z stdfloat Longest Trip (IOI23_longesttrip) C++17
0 / 100
5 ms 344 KB
#include "bits/stdc++.h"
#include "longesttrip.h"
using namespace std;

vector<int> longest_trip(int n, int D) {
    vector<int> v = {0};
    vector<bool> vis(n);
    while ((int)v.size() < ((n + 1) >> 1)) {
        bool tr = false;
        for (int i = 1; i < n && !tr; i++) {
            if (!vis[i] && are_connected({v.back()}, {i})) {
                v.push_back(i);
                tr = vis[i] = true;
            }
        }

        if (!tr) v.pop_back();
    }

    return v;
}
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB Incorrect
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB Incorrect
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 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 3 ms 344 KB Output is correct
3 Correct 3 ms 344 KB Output is correct
4 Correct 3 ms 344 KB Output is correct
5 Correct 3 ms 344 KB Output is correct
6 Correct 4 ms 344 KB Output is correct
7 Correct 3 ms 344 KB Output is correct
8 Correct 3 ms 344 KB Output is correct
9 Correct 3 ms 344 KB Output is correct
10 Correct 3 ms 344 KB Output is correct
11 Correct 3 ms 344 KB Output is correct
12 Correct 3 ms 344 KB Output is correct
13 Correct 3 ms 344 KB Output is correct
14 Incorrect 0 ms 340 KB invalid array
15 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB Incorrect
2 Halted 0 ms 0 KB -