답안 #1008692

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1008692 2024-06-26T16:43:23 Z Abito 가장 긴 여행 (IOI23_longesttrip) C++17
5 / 100
205 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){
        vis[v.back()]=1;
        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){
      |            ~~~~~~~~^~
# 결과 실행 시간 메모리 Grader output
1 Incorrect 205 ms 344 KB too many calls
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 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 4 ms 340 KB Output is correct
5 Correct 5 ms 344 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 4 ms 344 KB Output is correct
2 Correct 4 ms 344 KB Output is correct
3 Correct 4 ms 344 KB Output is correct
4 Correct 3 ms 344 KB Output is correct
5 Correct 4 ms 344 KB Output is correct
6 Incorrect 184 ms 344 KB too many calls
7 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 6 ms 344 KB Output is correct
2 Correct 5 ms 344 KB Output is correct
3 Correct 6 ms 344 KB Output is correct
4 Correct 5 ms 344 KB Output is correct
5 Correct 7 ms 344 KB Output is correct
6 Incorrect 182 ms 344 KB too many calls
7 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 4 ms 344 KB Output is correct
2 Correct 6 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 9 ms 344 KB Output is correct
6 Incorrect 174 ms 344 KB too many calls
7 Halted 0 ms 0 KB -