
PAT
PAT甲级题目
不太聪明的样子
这个作者很懒,什么都没留下…
展开
-
1010 Radix (25分) (C/C++)
考点:进制转换、整型溢出、二分 #include <iostream> #include <cmath> #include <cstring> #include <algorithm> typedef long long LL; using namespace std; //将base进制转换为10进制 LL get_value(string s, int base){ LL sum = 0; int digit; LL exp =原创 2021-01-27 21:31:50 · 152 阅读 · 0 评论 -
1004 Counting Leaves (30分)(C/C++)
考点:存树、BFS #include <stdio.h> #include <stdlib.h> #include <string.h> const int N = 105, M = 1e5 + 5; int h[N], to[M], ne[M], q[M], idx; int n, m; void add(int parent, int child){ to[idx] = child, ne[idx] = h[parent], h[parent] = idx原创 2021-01-19 12:44:31 · 133 阅读 · 0 评论