题解列表

筛选

c++解题思路

摘要:```cpp #include #define N 10 using namespace std; int temp=0; int main() { int a[N];……

蓝桥杯算法提高VIP-和最大子序列 C++ 动归

摘要: 思路: 动归. 对于每个数i来说,假设以该点为末尾的最大子序列和为f(i),那么f(i)的值只和 i , f(i-1) 有关.由于只和前一个值有关,也没必要维护dp数组. 如果f……

尼科彻斯定理

摘要:解题思路:这题最核心的内容是求出第一个最小奇数注意事项:printf("%.0f", pow(n, 3));//用c++输出的话会有科学计数法式的数据输出参考代码:#include<bits/stdc……

一次过 简单栈问题

摘要:解题思路:注意事项:参考代码:#include<bits/stdc++.h>using namespace std;int main(){ stack<char>q; string s; cin >>……

简单for循环

摘要:解题思路:1、根据对称性,只看前n/2行即可               2、发现奇数行和偶数行的规律                奇数行i/2个*-,结尾i/2个-*   中间全是
优质题解

最长上升子序列(贪心+二分)

摘要:线性DP(O(n^2)):[传送门](https://blog.dotcpp.com/a/91960 "动态规划") ------------ ## 贪心+二分(nlogn) ##### *……

c++解题思路

摘要:```cpp #include using namespace std; struct time { int year; int month; int day; };……

15行代码写完

摘要:解题思路:注意事项:参考代码:#include<iostream> using namespace std; int main() {     int a,b;     while(cin>……

没学过C++的都可以看懂

摘要:解题思路:注意事项:参考代码:#include <iostream>#include <cmath>using namespace std;int main() { int n; cin >> n; ……