neon 1510 sign uva
Lighting System Design uva11400
设计一个照明系统,一共有n(n<=1000)种灯泡可供选择,不同种类的灯泡必须用不同的电源,同一种灯泡则可以用一个,输入为一个n,以下n行,每行四个数值,代表电压V,电源费用K,每个灯泡费用C,所需灯泡数量L。n=0为结束标志。 为了省钱,你可以把一些灯泡换成电压更高的以节省电源的钱,但不能换成更低 ......
糖果 Candy uva1639
有两个盒子各有n (n<=2e5) 个糖,每天随机选一个(概率分别为p,1-p),然后吃一颗糖。直到有一天,没糖了!输入n,p,求此时另一个盒子里糖的个数的数学期望 假设最后某个盒子有 k 颗糖,然后计算概率即可 #include<iostream> #include<cstring> #inclu ......
Crossing Rivers uva12230
https://www.luogu.com.cn/problem/UVA12230 期望的线性性质 #include<iostream> #include<cstring> #include<algorithm> #include<set> using namespace std; int n,D; ......
Pole Arrangement uva1638
有高度分别为1到n的n根杆子排成一行。如果你从左侧或右侧看这些杆,较小的杆被较高的杆遮挡。 给出杆子的数量n,从左能看到的杆子数量L,从右能看到的杆子数量R,求杆子有多少种排列方式 考虑高度1~n的柱子, 把高度1的插入 2~i 的某个排列中转移 f[i ][j] [k ]=f[i-1][j-1][ ......
比赛名次 Race uva12034
两人赛马,最终名次有3种可能 求n人赛马时最终名次的可能性的个数 #include<iostream> #include<cstring> #include<algorithm> #include<set> using namespace std; #define mod 10056 int c[1 ......
Critical Mass uva 580
#include<iostream> #include<cstring> #include<algorithm> #include<set> using namespace std; int f[44],n; signed main() { int i; f[3]=1,f[4]=3; for(i=5 ......
unsigned和signed
#include <stdio.h> #include<iostream> using namespace std; void f(unsigned char v) { char c = v; unsigned char uc = v; unsigned int a = c, b = uc; int ......
编写一个程序以确定分别由signed及unsigned限定的char、short、int及long类型变量的取值范围。采用打印标准头文件中的相应值以及直接计算两种方式实现
#include <stdio.h> #include <limits.h> main() { printf("采用打印标准头文件limits.h的相应值\n"); //signer types printf("signed char min =%d\n", SCHAR_MIN); printf(" ......
Headshot UVA - 1636
#include<iostream> #include<vector> #include<cstring> #include<algorithm> using namespace std; const int N=104; string s; void sov(){ int i; int len=s ......
GCD等于XOR GCD XOR uva12716
给定一个数字n,如样例所示格式输出满足1<=b<=a<=n且gcd(a,b)==a xor b的(a,b)二元组个数 #include<iostream> #include<vector> #include<cmath> #include<algorithm> using namespace std ......
Choose and divide uva 10375
求C(i,j)/ C(u,v) 公式化简 筛出所有质数 除法的时候: 因数分解, 求对每个质数的个数的贡献 #include <iostream> #include <cstring> #include <cmath> #include <iomanip> #include <vector> usi ......
uva 12086
树状数组 1. 求区间和 2. 单点赋值 还是单点改,通过维护一个a[ i ],来求改变值 #include <iostream> #include <cstring> #include <sstream> using namespace std; const int N=2e5+4; int n, ......
Cyborg Genes UVA - 10723
求一个最短序列,使得输入的两个串的均为他的子序列,同时输出方案数。 n+m-LCS 方案数转移时求 #include <iostream> #include <cstring> using namespace std; #define int long long int n,m; char a[10 ......
旅行 Tour uva1347
直角坐标系中,有 nn 个点。要求先从左往右走,再从右往左走,不重复的经过每一个点。 求出最短路径(距离为两点间直线距离)。 f [i ][j ] 表示点 1~max(i,j) 已走过,的路径长度 #include <iostream> #include <algorithm> #include < ......
UVA847 A Multiplication Game 题解
双方都想取胜,要让对方必败就得让对方,到一个必败的点(也就是自己的必胜点),对方就会必败,而必败的点可以从最后反推回来。 ......
例题3-2 WERTYU(WERTYU, UVa10082)
题目 把手放在键盘上时,稍不注意就会往右错一位。这样,输入Q会变成输入 W,输入J会变成输入K等。键盘如图3-2所示。 输入一个错位后敲出的字符串(所有字母均大写),输出打字员本来想打出 的句子。输入保证合法,即一定是错位之后的字符串。例如输入中不会出现 大写字母A。 样例输入 O S, GOMR ......
例题3-1 TeX中的引号(Tex Quotes, UVa 272)
题目 在TeX中,左双引号是“``”,右双引号是“''”。输入一篇包含双引号的文章, 你的任务是把它转换成TeX的格式。 样例输入 "To be or not to be," quoth the Bard, "that is the question". 样例输出 ``To be or not to ......
git push error: not Signed-off-by author/committer/uploader in commit message footer
报错内容 git push error: not Signed-off-by author/committer/uploader in commit message footer 解决方案 点击查看代码 1. git commit --amend -s # 回车后,(1)删除或者按照commit规范 ......
使用PHP curl请求https的时候出现错误“SSL certificate problem: self signed certificate in certificate chain”
https://www.likecs.com/show-305773892.html ......