Submission #1006946

#TimeUsernameProblemLanguageResultExecution timeMemory
1006946De3b0oLongest Trip (IOI23_longesttrip)C++17
0 / 100
1 ms344 KiB
#include "longesttrip.h" #include<bits/stdc++.h> #include<random> #define ll long long #define F first #define S second #define in insert #define pb push_back #define ppb pop_back() #define d3 ios::sync_with_stdio(0);cin.tie(0);cout.tie(0); #define cans cout << ans << "\n"; #define yes cout << "Yes" << "\n"; #define no cout << "No" << "\n"; #define pll pair<ll,ll> #define lin cout << "\n"; #define sqr 340 #define mod 1000000007 #define mid ((l+r)/2) #define lc (2*n) #define rc (2*n+1) using namespace std; std::vector<int> longest_trip(int N, int D) { ll x; ll n = N; for(int i = 1 ; n>i ; i++) { if(are_connected({0},{i})==0) x=i; } vector<int> trnbo; trnbo.pb(0); for(int i = 1 ; n>i ; i++) { if(i==x) continue; trnbo.pb(i); } trnbo.pb(x); return trnbo; }

Compilation message (stderr)

longesttrip.cpp: In function 'std::vector<int> longest_trip(int, int)':
longesttrip.cpp:41:13: warning: 'x' may be used uninitialized in this function [-Wmaybe-uninitialized]
   41 |     trnbo.pb(x);
      |     ~~~~~~~~^~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...