(UPD: 2024-12-04 14:48 UTC) Judge is not working due to Cloudflare incident. (URL) We can do nothing about it, sorry. After the incident is resolved, we will grade all submissions.

Submission #1026878

#TimeUsernameProblemLanguageResultExecution timeMemory
1026878nisanduuMeetings (IOI18_meetings)C++14
0 / 100
5578 ms2140 KiB
#include "meetings.h" #include <bits/stdc++.h> using namespace std; typedef long long ll; std::vector<long long> minimum_costs(std::vector<int> H, std::vector<int> L, std::vector<int> R) { int Q = L.size(); std::vector<long long> C(Q); for (int j = 0; j < Q; ++j) { ll mini = 1e18; for(int i=L[i];i<=R[i];i++){ ll cr = 0; int maxi = 0; for(int k=L[i];k<=R[i];k++){ if(k==i) maxi = H[k]; maxi = max(maxi,H[k]); cr += maxi; } mini = min(mini,cr); } C[j] = mini; } return C; }

Compilation message (stderr)

meetings.cpp: In function 'std::vector<long long int> minimum_costs(std::vector<int>, std::vector<int>, std::vector<int>)':
meetings.cpp:12:18: warning: 'i' may be used uninitialized in this function [-Wmaybe-uninitialized]
   12 |     for(int i=L[i];i<=R[i];i++){
      |                  ^
#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...