#include<stdio.h>int main() { int ret = 1; int n = 0; int i = 0; int sum = 0; printf("请输入:\n"); scanf("%d", &n);\\输入n的值 for (i = 1; i <= n; i++) { ret ...
分类:
其他好文 时间:
2021-02-17 15:11:38
阅读次数:
0
试除法求约数个数。 int n; int divisor(int n) { int res=0; for(int i=1;i*i<=n;i++) if(n % i == 0) { res++; if(i != n/i) res++; } return res; } int main() { whil ...
分类:
其他好文 时间:
2021-02-17 14:14:28
阅读次数:
0
不开long long见祖宗。 struct Node { LL galleon,sickle,knut; }a,b; int main() { scanf("%d.%d.%d",&a.galleon,&a.sickle,&a.knut); scanf("%d.%d.%d",&b.galleon,& ...
分类:
其他好文 时间:
2021-02-16 12:33:27
阅读次数:
0
#include <bits/stdc++.h> const int N=200005; int n,v,a[N],dl[N][20],dr[N][20],pre[1<<20],suf[1<<20],dp[N],W; int main(){ scanf("%d%d",&n,&v); for (int ...
分类:
其他好文 时间:
2021-02-08 11:41:40
阅读次数:
0
#include <bits/stdc++.h> typedef long long ll; ll dp[40][40][40],ans; int n,a[40][40]; char s[40]; ll dfs(int l,int r,int mid){ if (l==r) return 1; if ...
分类:
其他好文 时间:
2021-02-08 11:40:55
阅读次数:
0
暴力朴素无优化写法: #include<bits/stdc++.h> using namespace std; const int maxn=1e3+5; int dp[maxn][maxn]; int v[maxn],w[maxn]; int main(){ int n,m;scanf("%d%d ...
分类:
其他好文 时间:
2021-02-04 12:02:33
阅读次数:
0
Aimee 想出状态转移的难度很小 很强的题解 #include<iostream> #include<cstdio> #include<cmath> #include<algorithm> #include<cstring> using namespace std; const int maxn= ...
分类:
其他好文 时间:
2021-02-03 10:32:32
阅读次数:
0
##1.求n的阶乘 #include<stdio.h> #include<stdlib.h> //n的阶乘 int f(int n) { if(1==n) { return 1; } return n*f(n-1); } int main() { int n; while(scanf("%d",&n ...
分类:
其他好文 时间:
2021-02-01 12:59:13
阅读次数:
0
##1.从键盘上输入字符,(1)分别统计一下其中字母,数字,其他字符的个数, (2)将统计的字母,数字,其他字符的个数以柱状图的形式打印。例如 #话不多说,上代码 #include<stdio.h> #include<stdlib.h> int main() { char c; int a[3]={ ...
分类:
其他好文 时间:
2021-02-01 12:58:26
阅读次数:
0
CSP算法题基础 C++程序里面会添加许多头文件,头文件的格式一般是 1763#include<头文件名> 我们先接触这两个头文件cstdio和iostream,其中cstdio包含了两个函数printf输出函数和scanf输入函数;第二个头文件是iostream,主要包含了cin,cout,end ...
分类:
编程语言 时间:
2021-02-01 12:55:52
阅读次数:
0