제출 #638887

#제출 시각아이디문제언어결과실행 시간메모리
638887SofiatpcFinancial Report (JOI21_financial)C++14
14 / 100
4066 ms340 KiB
#include <bits/stdc++.h> using namespace std; const int MAXN = 405; int N,D,a[MAXN],ans; bool marc[MAXN]; void bt(int i, int l) { if(i>N) { int cur=0; for(int j = 1; j <= N; j++) { if(!marc[j])continue; bool b = false; for(int k = 1; k < j; k++) if(marc[k] && a[k]>=a[j]){b=true; break;} if(!b)cur++; } ans=max(ans,cur); return; } if(i-l<D || l==0)bt(i+1,l); marc[i]=true; bt(i+1,i); marc[i]=false; return; } int main() { cin>>N>>D; for(int i = 1; i <= N; i++)cin>>a[i]; bt(1, 0); cout<<ans<<"\n"; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...