Submission #432871

#TimeUsernameProblemLanguageResultExecution timeMemory
432871Ruba_KStations (IOI20_stations)C++14
8 / 100
917 ms492 KiB
#include "stations.h" #include <vector> #include<bits/stdc++.h> using namespace std ; const int N = 1e3 + 3 ; vector<int> labels; int getlog(int i){ return log2(i + 1); } vector<int> label(int n, int k, vector<int> u, vector<int> v) { vector<int> labels (n); for(int i = 0 ; i < n ; i ++) labels[i] = i ; return labels; } int find_next_station(int s, int t,vector<int> c) { int a = getlog(s) , b = getlog(t); int last = t ; if(a < b){ while(a < b){ last = t ; b -- ; t -- ; t /= 2 ; } if(t == s) return last ; else return (s - 1) / 2 ; } return (s - 1) / 2; return c[0]; }

Compilation message (stderr)

stations.cpp: In function 'std::vector<int> label(int, int, std::vector<int>, std::vector<int>)':
stations.cpp:20:5: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
   20 |     for(int i = 0 ; i < n ; i ++)
      |     ^~~
stations.cpp:23:2: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
   23 |  return labels;
      |  ^~~~~~
#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...