제출 #959281

#제출 시각아이디문제언어결과실행 시간메모리
959281hyakupRoller Coaster Railroad (IOI16_railroad)C++17
11 / 100
2088 ms8396 KiB
#include <bits/stdc++.h> #include "railroad.h" using namespace std; #define ll long long const ll inf = 1e18; ll plan_roller_coaster( vector<int> s, vector<int> t) { int n = s.size(); ll resp = inf; vector<int> p; for( int i = 0; i < n; i++ ) p.push_back(i); do{ ll ans = 0; for( int i = 1; i < p.size(); i++ ) ans += max( (ll)t[p[i - 1]] - (ll)s[p[i]], 0LL ); resp = min( resp, ans ); }while( next_permutation(p.begin(), p.end()) ); return resp; }

컴파일 시 표준 에러 (stderr) 메시지

railroad.cpp: In function 'long long int plan_roller_coaster(std::vector<int>, std::vector<int>)':
railroad.cpp:15:25: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   15 |       for( int i = 1; i < p.size(); i++ ) ans += max( (ll)t[p[i - 1]] - (ll)s[p[i]], 0LL );
      |                       ~~^~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...