Submission #944182

#TimeUsernameProblemLanguageResultExecution timeMemory
944182beepbeepsheepMeetings (IOI18_meetings)C++17
0 / 100
5597 ms5444 KiB
#include "meetings.h" #include <bits/stdc++.h> using namespace std; #define ll long long const ll inf=1e18; #pragma GCC target ("avx2") #pragma GCC optimization ("O3") #pragma GCC optimization ("unroll-loops") 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; for (int i=0;i<q;i++){ ll tot=0,curr=0; for (int j=L[i];j<=R[i];j++){ if (H[j]==1) curr++; else tot=max(tot,curr),curr=0; } tot=max(tot,curr); ans.emplace_back((R[i]-L[i]+1)*2-tot); } return ans; }

Compilation message (stderr)

meetings.cpp:7: warning: ignoring '#pragma GCC optimization' [-Wunknown-pragmas]
    7 | #pragma GCC optimization ("O3")
      | 
meetings.cpp:8: warning: ignoring '#pragma GCC optimization' [-Wunknown-pragmas]
    8 | #pragma GCC optimization ("unroll-loops")
      | 
meetings.cpp: In function 'std::vector<long long int> minimum_costs(std::vector<int>, std::vector<int>, std::vector<int>)':
meetings.cpp:11:8: warning: unused variable 'n' [-Wunused-variable]
   11 |     ll 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...