摘要: #include<iostream> using namespace std; int arr[100010]; int main() { int n; cin >> n; int i; for (i = 1; i <= n; i++) { cin >> arr[i]; //输入非降序列 } int 阅读全文
posted @ 2023-05-23 15:00 刘海烽 阅读(69) 评论(0) 推荐(0)
摘要: #include <bits/stdc++.h> using namespace std; #define INF 0x3f3f3f3f const int N = 3000; // N为定点数,邻接矩阵中 N 一般不要超过5000,否则会存在内存问题 int n, m; int g[N][N], 阅读全文
posted @ 2023-05-19 01:24 刘海烽 阅读(38) 评论(0) 推荐(0)
摘要: #include <iostream> #include <cmath> using namespace std; #define N 300004 int d[N]; int distance(int n); int main() { //把每个要删除的数字的位置记录下来 //并且计算出他们到自己 阅读全文
posted @ 2023-05-18 22:49 刘海烽 阅读(18) 评论(0) 推荐(0)
摘要: #include<cstdio> #include<iostream> const int MAXN=1000005; const int INF=0x3f3f3f3f; const int mod=998244353; using namespace std; int pre[MAXN], a[M 阅读全文
posted @ 2023-05-18 13:51 刘海烽 阅读(49) 评论(0) 推荐(0)
摘要: #include<bits/stdc++.h> using namespace std; const int inf=0x3f3f3f3f; const int maxn=13000; int t,c,ts,te; int dis[maxn]; bool vis[maxn]; struct node 阅读全文
posted @ 2023-05-17 22:25 刘海烽 阅读(23) 评论(0) 推荐(0)
摘要: #include<iostream> #include<algorithm> using namespace std; struct Node { int w, v; }a[110]; bool cmp(Node aa, Node bb) { return aa.v * bb.w > aa.w * 阅读全文
posted @ 2023-05-14 11:41 刘海烽 阅读(30) 评论(0) 推荐(0)
摘要: #include<iostream> #include<cstring> using namespace std; //将字符串每一位改为数字,再反向计算,最后处理进位问题。 int main() { char a[101], b[101]; //定义字符数组是为了好测量,输入的长度 while ( 阅读全文
posted @ 2023-05-14 00:19 刘海烽 阅读(32) 评论(0) 推荐(0)
摘要: #include<bits/stdc++.h> using namespace std; int main() { int N; while(cin>>N) { int a[3001]={0}; int i=0; a[0]=1; while(N) { for(i=0;i<3001;i++) { if 阅读全文
posted @ 2023-05-13 23:24 刘海烽 阅读(23) 评论(0) 推荐(0)
摘要: #include <iostream> using namespace std; int main() { int a[50] = { 0 }, b[50] = {0}, m, n, i, x, j = 1, count = 0; while (cin >> m >> n) { x = m; //防 阅读全文
posted @ 2023-05-13 22:46 刘海烽 阅读(20) 评论(0) 推荐(0)
摘要: #include <bits/stdc++.h> using namespace std; const int maxn=206; int n[maxn],m[maxn],ans[maxn]; int main(int argc, char const *argv[]) { string a,b; 阅读全文
posted @ 2023-05-13 19:31 刘海烽 阅读(38) 评论(0) 推荐(0)