Submission #514914

#TimeUsernameProblemLanguageResultExecution timeMemory
514914mosiashvililukaHoliday (IOI14_holiday)C++14
23 / 100
15 ms3252 KiB
#include"holiday.h" #include<bits/stdc++.h> using namespace std; long long a,b,c,d,e,i,j,ii,jj,zx,xc,f[100009],D,pas,jm; priority_queue <long long> s; long long int findMaxAttraction(int Nn, int start, int Dd, int attraction[]) { a=Nn;start++;D=Dd; for(i=1; i<=a; i++){ f[i]=attraction[i-1]; } for(i=1; i<=a; i++){ if(i-1>D) break; s.push(-f[i]);jm+=f[i]; //cout<<"+ "<<f[i]<<"\n"; while(s.size()>max(0LL,D-(i-1))){ jm-=-s.top(); //cout<<"- "<<-s.top()<<"\n"; s.pop(); } pas=max(pas,jm); } return pas; }

Compilation message (stderr)

holiday.cpp: In function 'long long int findMaxAttraction(int, int, int, int*)':
holiday.cpp:15:17: warning: comparison of integer expressions of different signedness: 'std::priority_queue<long long int>::size_type' {aka 'long unsigned int'} and 'const long long int' [-Wsign-compare]
   15 |   while(s.size()>max(0LL,D-(i-1))){
      |         ~~~~~~~~^~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...