# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1061322 | noyancanturk | Longest Trip (IOI23_longesttrip) | C++17 | 12 ms | 600 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "longesttrip.h"
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
int n,d;
vector<int>getslice(int l,int r,deque<int>&v){
vector<int>res;
for(int i=l;i<=r;i++){
res.pb(v[i]);
}
return res;
}
vector<int>longest_trip(int N,int D){
n=N,d=D;
deque<int>trip1,trip2;
trip1.pb(0);
bool side=0;
for(int i=1;i<n;i++){
bool ok=are_connected({trip1.back()},{i});
if(ok){
trip1.pb(i);
side=0;
}else if(!trip2.size()||side){
trip2.pb(i);
side=1;
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |