제출 #903191

#제출 시각아이디문제언어결과실행 시간메모리
903191Sir_Ahmed_Imran휴가 (IOI14_holiday)C++17
47 / 100
5024 ms6236 KiB
///~~~LOTA~~~/// #include "holiday.h" #include <bits/stdc++.h> using namespace std; #define nl '\n' #define ff first #define ss second #define ll long long #define append push_back #define pii pair<int,int> #define all(x) (x).begin(),(x).end() #define MAXN 100001 ll findMaxAttraction(int n,int s,int d,int a[]){ ll m,o,p,q; multiset<ll> S; for(int i=m=0;i<n;i++){ o=0; for(int j=i;j<n;j++){ if(j<=s) p=q=s-i; else if(i>=s) p=q=j-s; else{ p=s-2*i+j; q=2*j-s-i; } p=min(p,q); p=d-p; if(p<=0) break; while(S.size()>p){ o-=*S.begin(); S.erase(S.begin()); } if(S.size()<p){ o+=a[j]; S.insert(a[j]); } else if(*S.begin()<a[j]){ o+=a[j]-*S.begin(); S.insert(a[j]); S.erase(S.begin()); } m=max(o,m); } S.clear(); if(!s) break; } return m; }

컴파일 시 표준 에러 (stderr) 메시지

holiday.cpp: In function 'long long int findMaxAttraction(int, int, int, int*)':
holiday.cpp:30:27: warning: comparison of integer expressions of different signedness: 'std::multiset<long long int>::size_type' {aka 'long unsigned int'} and 'long long int' [-Wsign-compare]
   30 |             while(S.size()>p){
      |                   ~~~~~~~~^~
holiday.cpp:34:24: warning: comparison of integer expressions of different signedness: 'std::multiset<long long int>::size_type' {aka 'long unsigned int'} and 'long long int' [-Wsign-compare]
   34 |             if(S.size()<p){
      |                ~~~~~~~~^~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...