Submission #846513

# Submission time Handle Problem Language Result Execution time Memory
846513 2023-09-07T17:03:20 Z Trisanu_Das Longest Trip (IOI23_longesttrip) C++17
5 / 100
7 ms 604 KB
#include <bits/stdc++.h>
using namespace std;
#include "longesttrip.h"
 
vector<int> longest_trip(int N, int D){
  vector<int> ans;
  int u = 0; ans.push_back(u);
  while(u < N - 1){
    if(are_connected({u}, {u + 1})) ans.push_back(++u);
    else if(u != N - 2){
      ans.push_back(u + 1); ans.push_back(u + 2); u += 2;
    }else{
      reverse(ans.begin(), ans.end()); ans.push_back(N - 1); u++;
    }
  }
  return ans;
}
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 344 KB Incorrect
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 7 ms 344 KB Output is correct
2 Correct 5 ms 344 KB Output is correct
3 Correct 4 ms 344 KB Output is correct
4 Correct 4 ms 344 KB Output is correct
5 Correct 4 ms 344 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 5 ms 344 KB Output is correct
2 Correct 4 ms 344 KB Output is correct
3 Correct 4 ms 596 KB Output is correct
4 Correct 5 ms 344 KB Output is correct
5 Correct 4 ms 344 KB Output is correct
6 Incorrect 1 ms 344 KB Incorrect
7 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 5 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 5 ms 344 KB Output is correct
5 Correct 4 ms 344 KB Output is correct
6 Incorrect 0 ms 344 KB Incorrect
7 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 6 ms 344 KB Output is correct
2 Correct 5 ms 344 KB Output is correct
3 Correct 4 ms 596 KB Output is correct
4 Correct 4 ms 344 KB Output is correct
5 Correct 4 ms 604 KB Output is correct
6 Incorrect 1 ms 344 KB Incorrect
7 Halted 0 ms 0 KB -