随笔分类 - 题解
摘要:#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:
阅读全文
摘要:题解:签到题,直接输出题干要求。 #include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { std::ios::sync_with_stdio(false); cin.tie(0); std::c
阅读全文
摘要:题解:两重循环,内层循环求阶乘的值,外层求和。 时间复杂度 O(n^2) 空间复杂度 O(n) #include <bits/stdc++.h> using namespace std; typedef long long ll; ll ans,n; int main() { std::ios::s
阅读全文
摘要:题解:快速幂,有人可能觉的水题没必要用快速幂,但是我认为写快速幂能更好的记住模板。 #include <bits/stdc++.h> using namespace std; typedef long long ll; ll ans,n; ll quickmi(ll a, ll n) // a:底数
阅读全文
摘要:PTA oj 不支持 gets() 函数wa了一发,粗略估计时间复杂度 O(n^2) 应该可以过 又wa 一发, 最后 O(n)时间做,多个 辅助空间的数组,空间复杂度多增加O(n),不过内存是足够的够,小问题。 #include <bits/stdc++.h> using namespace st
阅读全文
摘要:题解:用 sort函数,位于 <algorithm>中。 #include <bits/stdc++.h> using namespace std; typedef long long ll; int a[5]; int main() { for(int i = 0; i < 3; i++) cin
阅读全文
摘要:注意溢出问题,当时想着新生赛,应该不会有溢出的问题,白白贡献了一发wa,还有细节处理没处理好又白白贡献了 一发wa,这道题属于很简单的水题,有良好的代码习惯或者大量的编程一发即AC,我还是太菜了QAQ #include <bits/stdc++.h> using namespace std; typ
阅读全文

浙公网安备 33010602011771号