Submission #1008689

# Submission time Handle Problem Language Result Execution time Memory
1008689 2024-06-26T16:42:51 Z Abito Longest Trip (IOI23_longesttrip) C++17
0 / 100
1 ms 344 KB
#include "longesttrip.h"
#include <bits/stdc++.h>
#define pb push_back
using namespace std;
std::vector<int> longest_trip(int n, int D)
{
    vector<int> v;
    vector<bool> vis(n);
    v.pb(0);
    while (v.size()<n){
        for (int i=0;i<n;i++){
            if (vis[i]) continue;
            vector<int> x,y;x.pb(v.back());y.pb(i);
            if (!are_connected(x,y)) continue;
            v.pb(i);
            break;
        }
    }
    return v;
}

Compilation message

longesttrip.cpp: In function 'std::vector<int> longest_trip(int, int)':
longesttrip.cpp:10:20: warning: comparison of integer expressions of different signedness: 'std::vector<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   10 |     while (v.size()<n){
      |            ~~~~~~~~^~
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 344 KB non-disjoint arrays
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB non-disjoint arrays
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB non-disjoint arrays
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 344 KB non-disjoint arrays
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB non-disjoint arrays
2 Halted 0 ms 0 KB -