Submission #944143

#TimeUsernameProblemLanguageResultExecution timeMemory
944143teacupMeetings (IOI18_meetings)C++14
0 / 100
0 ms348 KiB
#include "meetings.h" #include <bits/stdc++.h> using namespace std; #define int long long #define ii pair<int,int> typedef vector<int> vi; #define iii tuple<int,int,int> typedef vector<ii> vii; typedef vector<iii> viii; typedef map<int,int> mii; #ifndef debug #define cerr if (0) cerr #endif const int INF=1e17; int32_t A[5005]; vi minimum_costs(vector<int32_t> H, vector<int32_t> L, vector<int32_t> R) { int Q = L.size(), N = H.size(); vi C; for (int _=0; _<Q; _++){ int L_ = L[_], R_ = R[_], actual_ans=INF; for (int i=L_; i<=R_; i++){ int ans=0; memset(A,0,sizeof(A)); for (int j = i-1; j >= L_; j--){ A[j] = max(A[j+1], H[j]); } for (int j = i+1; j <= R_; j++){ A[j] = max(A[j-1], H[j]); } for (int j=L_; j<=R_; j++) ans+=A[j]; actual_ans = min(ans, actual_ans); } C.push_back(actual_ans); } return C; }

Compilation message (stderr)

meetings.cpp: In function 'vi minimum_costs(std::vector<int>, std::vector<int>, std::vector<int>)':
meetings.cpp:23:20: warning: unused variable 'N' [-Wunused-variable]
   23 |  int Q = L.size(), N = H.size();
      |                    ^
#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...