제출 #818168

#제출 시각아이디문제언어결과실행 시간메모리
818168trucmaiFinancial Report (JOI21_financial)C++17
0 / 100
4070 ms3396 KiB
#include <bits/stdc++.h> using namespace std; #define ll long long const ll N = 3e5+5; ll n,d,a[N],dp[N],mx[N]; //dp[i] = max dp[j] + 1 va (a[i] > a[j] && |i-j| <= D) //wutdahell signed main(){ cin>>n>>d; for(ll i = 1;i <= n;++i) cin>>a[i]; // deque<ll>dq; // for(ll i = 1;i <= n;++i){ // while(!dq.empty() && a[dq.back()] < a[i]) dq.pop_back(); // while(!dq.empty() && dq.front() + d <= i) dq.pop_front(); // dq.push_back(i); // if(i <= d) mx[i] = a[dq.front()]; // } dp[1] = 1; for(ll i = 2;i <= n;++i){ dp[i] = 1; for(ll j = 1;j < i;++j){ if(i - j <= d) if(a[i] > a[j]) dp[i] = max(dp[i],dp[j] + 1); } } ll res = 0; cout<<dp[n]<<endl; }

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

Main.cpp: In function 'int main()':
Main.cpp:26:6: warning: unused variable 'res' [-Wunused-variable]
   26 |   ll res = 0;
      |      ^~~
#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...