# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
944143 | 2024-03-12T09:00:18 Z | teacup | Meetings (IOI18_meetings) | C++14 | 0 ms | 348 KB |
#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
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 348 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 348 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 344 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 344 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 348 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |