Submission #861457

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
8614572023-10-16 08:51:54gurkotOvertaking (IOI23_overtaking)C++17
9 / 100
3 ms11356 KiB
#include "overtaking.h"
#include <iostream>
#include <algorithm>
#include <vector>
//#include <cstdlib>
using namespace std;
int n,m,x;
long long t[1001][1001]; int w[1001][1001];
int s[1001];
void init(int L, int N, std::vector<long long> T, std::vector<int> W,
int X, int M, std::vector<int> S) {
n=0; m=M; x=X;
for (int i=0;i<M;i++)s[i]=S[i];
int nom;
for (int i=0;i<N;i++)
if (W[i]>X) {
w[0][n]=W[i];t[0][n]=T[i];
nom=n;
while (nom>0)
if (t[0][nom]==t[0][nom-1] && w[0][nom]>w[0][nom-1])
{swap(t[0][nom],t[0][nom-1]);swap(w[0][nom],w[0][nom-1]);nom--;}
else break;
n++;
}
//counting without reserve bus (precalculation)
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

overtaking.cpp: In function 'void init(int, int, std::vector<long long int>, std::vector<int>, int, int, std::vector<int>)':
overtaking.cpp:19:2: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
   19 |  for (int i=0;i<N;i++)
      |  ^~~
overtaking.cpp:31:3: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
   31 |   for (int i=1;i<m;i++) {
      |   ^~~
#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...
#Verdict Execution timeMemoryGrader output
Fetching results...