夜语声烦-
夜语声烦-
全部文章
题解
归档
标签
去牛客网
登录
/
注册
夜语声烦-的博客
全部文章
/ 题解
(共33篇)
题解 | #素数回文#
素数回文 #include <bits/stdc++.h> using namespace std; typedef long long LL; string s; bool isprime(LL n) { for(LL i = 2; i <= n / i;...
C++
2022-05-12
0
301
题解 | #素数判断#
素数判断 #include <bits/stdc++.h> using namespace std; int n, T; bool isprime(int n)//普通的判断素数 { bool f = true; for(int i = 2; i <= n /...
C++
2022-05-12
5
310
题解 |
递归 牛客这边可以过,但是一本通那边会超时 #include<iostream> using namespace std; int res = 1; void fun(int k) { for(int i = 1; i <= k >> 1; i +...
C++
2022-05-05
1
265
题解 | #[NOIP2001]数的划分#
[NOIP2001]数的划分 #include <iostream> using namespace std; int n, k, cnt; void dfs(int u, int s, int sum)//当前分成u份 上一个选择的数是s 当前总和是sum { if(u ...
C++
深度优先搜索
2022-03-22
1
450
题解 | #活动安排#
活动安排 #include <bits/stdc++.h> #define x first #define y second using namespace std; typedef pair<int, int> PII; const int N = 1010; in...
C++
贪心
2022-03-14
0
390
题解 | #[NOIP2010]数字统计#
[NOIP2010]数字统计 杀鸡用牛刀了属于是 # include <iostream> # include <cmath> using namespace std; int dgt(int n) // 计算整数n有多少位 { int res = 0; ...
C++
2022-03-11
1
315
题解 | #[NOIP2011]数字反转#
[NOIP2011]数字反转 #include <bits/stdc++.h> using namespace std; int n; int main() { cin >> n; if(n < 0) { n = -n; ...
2022-03-10
2
395
题解 | #[NOIP2013]表达式求值#
[NOIP2013]表达式求值 #include <iostream> using namespace std; int n,m,ans; char c; int main() { cin >> n; while(~scanf("%c%d",&c...
C++
2022-03-03
17
476
题解 | #[NOIP2013]记数问题#
好吧,说实话我还以为是计数类DP,没想到完全想复杂了,不过我这是万能的,可以求任意x~y直接任意z的出现次数,用前缀和就行cnt(y,z) - cnt(x-1,z) # include <iostream> # include <cmath> using namespace ...
C++
动态规划
2022-02-07
1
539
题解 | #阶乘之和#
#include<iostream> using namespace std; const int N = 1010; int a[N],res[N]; int n,s; int main() { cin >> n; res[0] = a[0] = 1; ...
C++
C
2022-01-22
0
262
首页
上一页
1
2
3
4
下一页
末页