上一页 1 ··· 18 19 20 21 22 23 24 25 26 ··· 33 下一页
摘要: 题意: 输入一个不超过20位的正整数,问乘2以后是否和之前的数组排列相同(数字种类和出现的个数不变),输出Yes或No,并输出乘2后的数字。 AAAAAccepted code: 1 #define HAVE_STRUCT_TIMESPEC 2 #include<bits/stdc++.h> 3 u 阅读全文
posted @ 2019-08-31 16:45 sewage 阅读(186) 评论(0) 推荐(0) 编辑
摘要: //树状数组中数组的特性,有更巧妙的方法。//我们知道在树状数组中,对于数组tree[i],它所维护的区间为[i−lowbit(i)+1,i]//所以对于tree[2^i],它所维护的区间就为[1,2^i]。//所以就可以利用此特性加上树状数组的操作,维护一个类似倍增方法,并且支持在线修改操作。#d 阅读全文
posted @ 2019-08-30 15:58 sewage 阅读(140) 评论(0) 推荐(0) 编辑
摘要: 题意: 输入一个正整数N(<=10000),接下来输入N组数据,ID,书名,作者,关键词,出版社,出版年份。 然后输入一个正整数M(<=1000),接下来输入查询的数据,递增输出ID,若没有查找到则输出Not Found。 trick: 第三组数据中会有需要补0的ID,建议采用printf("%07 阅读全文
posted @ 2019-08-30 14:52 sewage 阅读(124) 评论(0) 推荐(0) 编辑
摘要: #define HAVE_STRUCT_TIMESPEC#include<bits/stdc++.h>using namespace std;int a[2007];set<int>s;int main(){ int n; cin>>n; int iend=n+1; for(int i=1;i<=n 阅读全文
posted @ 2019-08-26 23:14 sewage 阅读(157) 评论(0) 推荐(0) 编辑
摘要: #define HAVE_STRUCT_TIMESPEC#include <bits/stdc++.h>using namespace std;int val[300007],num[300007],ans=0;vector<int>v[300007];void dfs(int u){ if(v[u 阅读全文
posted @ 2019-08-20 20:38 sewage 阅读(120) 评论(0) 推荐(0) 编辑
摘要: #define HAVE_STRUCT_TIMESPEC//编译器中time.h和phread.h头文件中timespec结构体重名,故加此行#include<bits/stdc++.h>using namespace std;int a[200007],b[2000007];priority_qu 阅读全文
posted @ 2019-08-19 15:42 sewage 阅读(186) 评论(0) 推荐(0) 编辑
摘要: #define HAVE_STRUCT_TIMESPEC#include<bits/stdc++.h>using namespace std;const int maxn=300;const int inf=1e9;long long a[100007];long long b[100007];in 阅读全文
posted @ 2019-08-19 15:17 sewage 阅读(258) 评论(0) 推荐(0) 编辑
摘要: #include<bits/stdc++.h>using namespace std;const long long mod = 998244353;string s;int a[300007];long long x[7],y[7];int main(){ int n; cin>>n; cin>> 阅读全文
posted @ 2019-08-18 10:02 sewage 阅读(213) 评论(0) 推荐(0) 编辑
摘要: #include<bits/stdc++.h>using namespace std;string s;char ans[200007][7];char anss[200007][7];int main(){ cin>>s; int n=s.size(); int sta=0; int cnt=1; 阅读全文
posted @ 2019-08-18 09:46 sewage 阅读(179) 评论(0) 推荐(0) 编辑
摘要: 题意: 输入一个正整数N(N<=10000),然后输入N-1条边,求使得这棵树深度最大的根节点,递增序输出。如果不是一棵树,输出这张图有几个部分。 trick: 时间比较充裕数据可能也不是很极限,所以用了一个暴力的手段。直接枚举度数为1的点进行深度优先搜索,如果递归了一万次还没有return就当它有 阅读全文
posted @ 2019-08-15 16:02 sewage 阅读(185) 评论(0) 推荐(0) 编辑
上一页 1 ··· 18 19 20 21 22 23 24 25 26 ··· 33 下一页