Submission #587041

#TimeUsernameProblemLanguageResultExecution timeMemory
587041krit3379Holiday (IOI14_holiday)C++17
23 / 100
17 ms2048 KiB
#include<bits/stdc++.h> #include"holiday.h" using namespace std; #pragma GCC optimize("O3,unroll-loops") #pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt") #define N 100005 long long ans; long long int findMaxAttraction(int n,int st,int d,int a[]){ int i; if(n<=3000){ } else if(st==0){ long long sum=0; priority_queue<long long,vector<long long>,greater<long long>> q; for(i=0;i<n;i++){ q.push(a[i]); sum+=a[i]; while(q.size()>d-i){ sum-=q.top(); q.pop(); } ans=max(ans,sum); } } return ans; }

Compilation message (stderr)

holiday.cpp: In function 'long long int findMaxAttraction(int, int, int, int*)':
holiday.cpp:21:27: warning: comparison of integer expressions of different signedness: 'std::priority_queue<long long int, std::vector<long long int>, std::greater<long long int> >::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   21 |             while(q.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...