Submission #787924

#TimeUsernameProblemLanguageResultExecution timeMemory
787924tolbiHoliday (IOI14_holiday)C++17
0 / 100
13 ms1488 KiB
#pragma optimize("Bismillahirrahmanirrahim") //█▀█─█──█──█▀█─█─█ //█▄█─█──█──█▄█─█■█ //█─█─█▄─█▄─█─█─█─█ //Allahuekber //ahmet23 orz... //FatihSultanMehmedHan //YavuzSultanSelimHan //AbdulhamidHan //Sani buyuk Osman Pasa Plevneden cikmam diyor #define author tolbi #include <bits/stdc++.h> using namespace std; template<typename X, typename Y> ostream& operator<<(ostream& os, pair<X,Y> pr) {return os<<pr.first<<" "<<pr.second;} template<typename X> ostream& operator<<(ostream& os, vector<X> v){for (auto &it : v) os<<it<<" ";return os;} template<typename X, size_t Y> ostream& operator<<(ostream& os, array<X,Y> v){for (auto &it : v) os<<it<<" ";return os;} ostream& operator<<(ostream& os, bool bl){return os<<(int32_t)bl;} #define endl '\n' #define deci(x) int x;cin>>x; #define decstr(x) string x;cin>>x; #define cinarr(x) for(auto &it : x) cin>>it; #define coutarr(x) for(auto &it : x) cout<<it<<" ";cout<<endl; #define sortarr(x) sort(x.begin(), x.end()) #define sortrarr(x) sort(x.rbegin(), x.rend()) #define rev(x) reverse(x.begin(), x.end()) #define tol(bi) (1ll<<((int)(bi))) typedef long long ll; const ll INF = LONG_LONG_MAX; const ll MOD = 1e9+9; mt19937 ayahya(chrono::high_resolution_clock().now().time_since_epoch().count()); #include"holiday.h" long long int findMaxAttraction(int n, int start, int d, int arr[]) { if (start==0){ ll ans = 0; priority_queue<int> pq; ll crr = 0; for (int i = 0; i < min(d,n); ++i) { pq.push(arr[i]); crr+=arr[i]; while (pq.size()>d-i) { crr-=pq.top(); pq.pop(); } ans=max(ans,crr); } return ans; } return 23; }

Compilation message (stderr)

holiday.cpp:1: warning: ignoring '#pragma optimize ' [-Wunknown-pragmas]
    1 | #pragma optimize("Bismillahirrahmanirrahim")
      | 
holiday.cpp: In function 'long long int findMaxAttraction(int, int, int, int*)':
holiday.cpp:42:29: warning: comparison of integer expressions of different signedness: 'std::priority_queue<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   42 |             while (pq.size()>d-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...