제출 #1064414

#제출 시각아이디문제언어결과실행 시간메모리
1064414wood휴가 (IOI14_holiday)C++17
0 / 100
5070 ms2760 KiB
#include"holiday.h" #include <bits/stdc++.h> using namespace std; #define vi vector<int> #define ll long long #define pb push_back long long int findMaxAttraction(int n, int start, int d, int attraction[]) { ll result = 0; for (int i = 0; i <= start; ++i) { for(int j = start; j<n; j++){ if(j-i+1>d) continue; vi res; for(int k = i; k<=j;k++){ res.pb(attraction[k]); } sort(res.begin(),res.end(), greater<>()); int left = d-j+i-1; left = min(d,(int)res.size()); ll sum = 0; for(int k = 0; k<left; k++){ sum+=res[k]; } result = max(result,sum); } } return result; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...