首页
DreamJudge
院校信息
考研初试
机试真题
讨论区
兑换中心
登录
注册
上岸
以下题解仅供学习参考使用。
抄袭、复制题解,以达到刷AC率/AC数量或其他目的的行为,在N诺是严格禁止的。
N诺非常重视学术诚信。此类行为将会导致您成为作弊者。具体细则请查看N诺社区规则。
RingoCrystal
2025年2月16日 14:21
最长连号 题解:dp最长加一子序列
P1571
回复 0
|
赞 3
|
浏览 529
#include <bits/stdc++.h> using namespace std; int main(){ int n; while (cin >> n) { vector<int> a(n),dp(n,1); for (int i = 0; i < n; i++)cin >> a[i]; int maxx = dp[0]; for (int i = 1; i < n; i++) { ...
DestinyCares+++
2024年3月12日 18:55
最长连号 题解:
P1571
回复 0
|
赞 2
|
浏览 950
#include<iostream> #include<string> #include<algorithm> #include<climits> #include<vector> using namespace std; const int maxn = 1000005; int dp[maxn];//dp[i]表示以arr[i]结尾的最长连号 int arr[maxn]; int main() { int n; cin ...
xjnotywlq
2024年3月12日 16:54
最长连号 题解:dp
P1571
回复 0
|
赞 1
|
浏览 766
#include <stdio.h> #include <stdlib.h> #include <string.h> int main() { int n; int a[10000]; scanf("%d",&n); for(int i=0;i<n;i++)scanf("%d",&a[i]); int dp[10000]; &...
Sacan
2022年7月1日 23:43
最长上升子串。而不是最长上升子序列
P1571
回复 0
|
赞 3
|
浏览 5.5k
#include <iostream> #include <vector> #include <algorithm> using namespace std; /* 最长上升子串版本 */ int main() { int n; while(cin >> n){ vector<int> a(n); vector<int> dp(n,1); for(int i = 0;i < n;i++){ ...
题目
最长连号
题解数量
4
发布题解
在线答疑
热门题解
1
最长连号 题解:dp最长加一子序列
2
最长上升子串。而不是最长上升子序列
3
最长连号 题解:
4
最长连号 题解:dp