上一页 1 ··· 21 22 23 24 25 26 27 28 29 ··· 33 下一页
摘要: 题意:给出一棵树的点数N,输入M行,每行输入父亲节点An,儿子个数n,和a1,a2,...,an(儿子结点编号),从根节点层级向下依次输出当前层级叶子结点个数,用空格隔开。(0<N<100) AAAAAccepted code: 1 #include<bits/stdc++.h> 2 using n 阅读全文
posted @ 2019-07-18 14:40 sewage 阅读(196) 评论(0) 推荐(0) 编辑
摘要: 题意:n个点,m条双向边,每条边给出通过用时,每个点给出点上的人数,给出起点终点,求不同的最短路的数量以及最短路上最多能通过多少人。(N<=500) AAAAAccepted code: 1 #include<bits/stdc++.h> 2 using namespace std; 3 int n 阅读全文
posted @ 2019-07-16 12:20 sewage 阅读(396) 评论(0) 推荐(0) 编辑
摘要: 题意:给出两个多项式,计算两个多项式的和,并以指数从大到小输出多项式的指数个数,指数和系数。 AAAAAccepted code: 1 #include<bits/stdc++.h> 2 using namespace std; 3 double a[1007]; 4 int main(){ 5 i 阅读全文
posted @ 2019-07-15 21:18 sewage 阅读(156) 评论(0) 推荐(0) 编辑
摘要: 题意:给两个整数a,b,计算a+b的值并每三位用逗号隔开输出(−1e6​​≤a,b≤1e6​​) AAAAAccepted code: 1 #include<bits/stdc++.h> 2 using namespace std; 3 int main(){ 4 int a,b; 5 cin>>a 阅读全文
posted @ 2019-07-15 21:15 sewage 阅读(119) 评论(0) 推荐(0) 编辑
摘要: #include<bits/stdc++.h>using namespace std;int sg[1007];int main(){ int t; cin>>t; while(t--){ int n,k; cin>>n>>k; if(k%3==0){ n%=(k+1); if(n==k||n%3) 阅读全文
posted @ 2019-07-15 21:11 sewage 阅读(188) 评论(0) 推荐(0) 编辑
摘要: #include<bits/stdc++.h>using namespace std;string s[100007];set<int>st[100007][7];int t[207];int a[100007],b[100007][2],c[100007],d[100007][2];int mai 阅读全文
posted @ 2019-07-14 16:22 sewage 阅读(158) 评论(0) 推荐(0) 编辑
摘要: #include<bits/stdc++.h>using namespace std;int f[2][200007],s[2][200007];//并查集,相邻点int find_(int *f,int x){ return f[x]==x?x:f[x]=find_(f,f[x]);}void a 阅读全文
posted @ 2019-05-12 17:19 sewage 阅读(110) 评论(0) 推荐(0) 编辑
摘要: #include<bits/stdc++.h>using namespace std;int a[100007];int cnt[100007];int main(){ int n; scanf("%d",&n); for(int i=1;i<=n;i++) scanf("%d",&a[i]); i 阅读全文
posted @ 2019-05-10 13:57 sewage 阅读(111) 评论(0) 推荐(0) 编辑
摘要: #include<bits/stdc++.h>using namespace std;typedef struct{ double k,b;}node;node k[1000007];bool cmp(node&a,node&b){ if(a.k==b.k) return a.b<b.b; retu 阅读全文
posted @ 2019-05-10 13:54 sewage 阅读(181) 评论(0) 推荐(0) 编辑
摘要: 1 #include<bits/stdc++.h> 2 using namespace std; 3 int n,m,l,t; 4 int a[1307][137][67]; 5 int vis[1307][137][67]; 6 typedef struct{ 7 int x,y,z; 8 }no 阅读全文
posted @ 2019-05-09 22:45 sewage 阅读(162) 评论(0) 推荐(0) 编辑
上一页 1 ··· 21 22 23 24 25 26 27 28 29 ··· 33 下一页