제출 #1075358

#제출 시각아이디문제언어결과실행 시간메모리
1075358mindiyak휴가 (IOI14_holiday)C++14
0 / 100
5049 ms10472 KiB
#include"holiday.h" #include <vector> #include <set> #include <iostream> using namespace std; #define ll long long ll ans = 0; long long int findMaxAttraction(int n, int start, int d, int attraction[]) { for(int k=1;k<(1<<n);k++){ int a = n+1, b = -1, cnt = 0; ll val = 0; // cerr << k << " "; for(int i=0;i<n;i++){ cerr << ((1<<i)&k); if(((1<<i)&k)>0){ a = min(i,a); b = max(b,i); cnt ++; val += attraction[i]; } } // cerr << " | " << a << " " << b; int len = b-a; a = min(abs(start - a),abs(start - b)); // cerr << " | " << a << " " << len << " " << cnt << " " << val << endl; if((a+len+cnt) > d)continue; ans = max(ans,val); } return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...