Submission #100098

#TimeUsernameProblemLanguageResultExecution timeMemory
100098SomeoneUnknownRoller Coaster Railroad (IOI16_railroad)C++14
0 / 100
2048 ms4244 KiB
#include "railroad.h" #include <bits/stdc++.h> using namespace std; long long plan_roller_coaster(vector<int> s, vector<int> t) { long long tal = 0; int p2[s.size()]; for(int i = 0; i < s.size(); i++){ p2[i] = i; } do{ long long p = 1; long long subtal = 0; for(int i = 0; i < s.size(); i++){ subtal += max(0LL, p-s[p2[i]]); p = t[p2[i]]; } }while(next_permutation(p2, p2+s.size())); }

Compilation message (stderr)

railroad.cpp: In function 'long long int plan_roller_coaster(std::vector<int>, std::vector<int>)':
railroad.cpp:8:22: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for(int i = 0; i < s.size(); i++){
                    ~~^~~~~~~~~~
railroad.cpp:14:26: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         for(int i = 0; i < s.size(); i++){
                        ~~^~~~~~~~~~
railroad.cpp:6:15: warning: unused variable 'tal' [-Wunused-variable]
     long long tal = 0;
               ^~~
railroad.cpp:19:1: warning: no return statement in function returning non-void [-Wreturn-type]
 }
 ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...