# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
944125 | 2024-03-12T08:44:46 Z | beepbeepsheep | Meetings (IOI18_meetings) | C++17 | 326 ms | 2900 KB |
#include "meetings.h" #include <bits/stdc++.h> using namespace std; #define ll long long const ll inf=1e18; std::vector<long long> minimum_costs(std::vector<int> H, std::vector<int> L, std::vector<int> R) { ll n=H.size(); ll q=L.size(); vector<ll> ans; ll arr[3005]; for (int i=0;i<q;i++){ ll tot=inf; for (int j=L[i];j<=R[i];j++){ ll curr=0; memset(arr,0,sizeof(arr)); arr[j]=H[j]; for (int k=j-1;k>=L[i];k--){ arr[k]=max<ll>(arr[k+1],H[k]); } for (int k=j+1;k<=R[i];k++){ arr[k]=max<ll>(arr[k-1],H[k]); } for (int k=L[i];k<=R[i];k++) curr+=arr[k]; tot=min(tot,curr); } ans.emplace_back(tot); } return ans; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 348 KB | Output is correct |
2 | Correct | 50 ms | 348 KB | Output is correct |
3 | Correct | 318 ms | 488 KB | Output is correct |
4 | Correct | 97 ms | 348 KB | Output is correct |
5 | Correct | 320 ms | 596 KB | Output is correct |
6 | Correct | 32 ms | 348 KB | Output is correct |
7 | Correct | 1 ms | 348 KB | Output is correct |
8 | Correct | 12 ms | 348 KB | Output is correct |
9 | Correct | 326 ms | 460 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 348 KB | Output is correct |
2 | Correct | 50 ms | 348 KB | Output is correct |
3 | Correct | 318 ms | 488 KB | Output is correct |
4 | Correct | 97 ms | 348 KB | Output is correct |
5 | Correct | 320 ms | 596 KB | Output is correct |
6 | Correct | 32 ms | 348 KB | Output is correct |
7 | Correct | 1 ms | 348 KB | Output is correct |
8 | Correct | 12 ms | 348 KB | Output is correct |
9 | Correct | 326 ms | 460 KB | Output is correct |
10 | Runtime error | 2 ms | 856 KB | Execution killed with signal 11 |
11 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 348 KB | Output is correct |
2 | Runtime error | 9 ms | 2900 KB | Execution killed with signal 11 |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 348 KB | Output is correct |
2 | Runtime error | 9 ms | 2900 KB | Execution killed with signal 11 |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 348 KB | Output is correct |
2 | Correct | 50 ms | 348 KB | Output is correct |
3 | Correct | 318 ms | 488 KB | Output is correct |
4 | Correct | 97 ms | 348 KB | Output is correct |
5 | Correct | 320 ms | 596 KB | Output is correct |
6 | Correct | 32 ms | 348 KB | Output is correct |
7 | Correct | 1 ms | 348 KB | Output is correct |
8 | Correct | 12 ms | 348 KB | Output is correct |
9 | Correct | 326 ms | 460 KB | Output is correct |
10 | Runtime error | 2 ms | 856 KB | Execution killed with signal 11 |
11 | Halted | 0 ms | 0 KB | - |