随笔分类 - 模拟
摘要:给定一个长度为N的数列,求数值严格单调递增的子序列的长度最长是多少。 输入格式 第一行包含整数N。 第二行包含N个整数,表示完整序列。 输出格式 输出一个整数,表示最大长度。 数据范围 1≤N≤100000−109≤数列中的数≤109 输入样例: 7 3 1 2 1 8 5 6 输出样例: 4 严格
        阅读全文
                
摘要:https://www.acwing.com/problem/content/1326/ 思路: 枚举起点 正反方向 如果满足.输出 #include <bits/stdc++.h> using namespace std; int n; int g[16][16]; int dx[4] = {-1
        阅读全文
                
摘要:给定一个单链表 L1→L2→⋯→Ln-1→Ln,请编写程序将链表重新排列为 Ln→L1→Ln−1→L2→⋯。例如:给定L为1→2→3→4→5→6,则输出应该为6→1→5→2→4→3。 输入格式: 每个输入包含1个测试用例。每个测试用例第1行给出第1个结
        阅读全文
                
摘要:Maxim Buys an Apartment #include <iostream> #define int long long using namespace std; int n,k; signed main() { ios::sync_with_stdio(0); cin.tie(0); c
        阅读全文
                
摘要:https://www.luogu.com.cn/problem/P1022 #include<cstdio> #include<cstring> using namespace std; double num=0,x=0;//num是数字之和,x为系数之和 char c,p;//c被用作读入每一个
        阅读全文
                
摘要:https://www.luogu.com.cn/problem/P1149先把所有的数表示出来 #include <cstdio> #include <iostream> using namespace std; int b[1000] = {6, 2, 5, 5, 4, 5, 6, 3, 7, 
        阅读全文
                
                    
                
浙公网安备 33010602011771号