摘要: #include <bits/stdc++.h> using namespace std; typedef long long ll; int n,col; char c; int main() { std::ios::sync_with_stdio(false); cin.tie(0); std: 阅读全文
posted @ 2020-02-03 17:19 留幸愉 阅读(213) 评论(0) 推荐(0) 编辑
摘要: 题解:签到题,直接输出题干要求。 #include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { std::ios::sync_with_stdio(false); cin.tie(0); std::c 阅读全文
posted @ 2020-02-03 00:27 留幸愉 阅读(127) 评论(0) 推荐(0) 编辑
摘要: 题解:两重循环,内层循环求阶乘的值,外层求和。 时间复杂度 O(n^2) 空间复杂度 O(n) #include <bits/stdc++.h> using namespace std; typedef long long ll; ll ans,n; int main() { std::ios::s 阅读全文
posted @ 2020-02-03 00:25 留幸愉 阅读(356) 评论(0) 推荐(0) 编辑
摘要: 题解:快速幂,有人可能觉的水题没必要用快速幂,但是我认为写快速幂能更好的记住模板。 #include <bits/stdc++.h> using namespace std; typedef long long ll; ll ans,n; ll quickmi(ll a, ll n) // a:底数 阅读全文
posted @ 2020-02-03 00:17 留幸愉 阅读(226) 评论(0) 推荐(0) 编辑
摘要: PTA oj 不支持 gets() 函数wa了一发,粗略估计时间复杂度 O(n^2) 应该可以过 又wa 一发, 最后 O(n)时间做,多个 辅助空间的数组,空间复杂度多增加O(n),不过内存是足够的够,小问题。 #include <bits/stdc++.h> using namespace st 阅读全文
posted @ 2020-02-03 00:05 留幸愉 阅读(164) 评论(0) 推荐(0) 编辑