算法刷题


最大子列和问题 需要的结果有 子列最大值 输出序列中的下标/值 第一种可用直接用mp或者dp去解决 void solve(){ int sum = -mod; int n,m; cin >> n; for(int i = 1; i <= n; i ++ ){ cin >> a

洛谷刷题时间处理


题目https://www.luogu.com.cn/problem/P8665 输入处理: sc.nextInt() 读取测试用例数量 t。 sc.nextLine() 读取并丢弃剩余的换行符,避免影响后续输入。