제출 #619749

#제출 시각아이디문제언어결과실행 시간메모리
619749gonzakia29Financial Report (JOI21_financial)C++17
0 / 100
121 ms6960 KiB
#include <iostream> using namespace std; int n, d; int nums[300010]; int dp[300010]; int mini[300000]; int maxi; int main(){ cin >> n >> d; for (int i = 0; i < n; ++i){ cin >> nums[i]; dp[i] = 1; mini[i] = 1000000001; } for (int i = 1; i < n; ++i){ if (nums[i] > nums[i-1]){ dp[i] += dp[i-1]; mini[dp[i]] = min(mini[dp[i]], nums[i]); if (nums[i] > mini[dp[i]]){ dp[i]++; mini[dp[i]] = min(mini[dp[i]], nums[i]); } } if (nums[i] == nums[i-1]){ dp[i] = dp[i-1]; } } for (int i = 0; i < n; ++i){ maxi = max(maxi, dp[i]); } cout << maxi; }
#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...