- 博客(10)
- 收藏
- 关注
原创 python 判断指针是否到达文件末尾 | 判断文件读取结束
with open('awod.txt','rb') as f: print(f.seek(0,2))
2020-03-31 21:24:51
5370
原创 80端口被System/IIS占用?WampServer没有绿?
80端口被System/IIS占用?WampServer没有绿? (WampServer 3) 杀死占用80端口的进程并非是好主意,尤其是被System占用时。 也没必要到conf文件改端口,在图标右键有选项了。。 只是因为8080端口也被占用了,改了没有用,所以一头雾水,改成8090就好啦。 ps.验证: http://localhost:8090 ...
2020-03-26 22:43:53
276
原创 mysql8.0 重置密码 解决报错1045
全部用管理员运行cmd 1.net stop mysql 2.mysqld --console --skip-grant-tables --shared-memory 3.因为步骤2的操作正在占用cmd,重开一个cmd 4.新开的cmd中执行mysql 5.use mysql 6.update user set authentication_string = '' where us...
2020-02-22 10:36:07
590
2
原创 KMP
学习了 KMP(Knuth-Morris-Pratt) 字符串匹配算法,记录下代码。 public class KMP { private int[][] dp; private String pat; public KMP(String pat) { this.pat = pat; int M = pat.length(); ...
2019-11-02 10:22:14
275
翻译 洛谷 P1036
题目大意: 输入n个整数,从中任选k个加到一起,统计和为素数的所有可能方法的数量。 int x[25]; int n,k; bool isPrime(int x){ //判断一个数是否为素数 //... } int cm(int k_desc, int already_sum, int begin, int end) { if(k_desc==0) { retu...
2019-06-02 14:51:35
322
原创 UVA495 Fibonacci Freeze
题意并不难,但是注意容易出现 runtime error,先上AC #include<iostream> using namespace std; int fib[5005][1100]={0}; int main() { fib[0][0]=0; fib[1][0]=1; fib[2][0]=1; for(int i=3;i<=5001;...
2019-05-15 20:40:23
256
原创 加法运算
加法运算: for i 0 to size() { temp = a[i]+sum[i]; sum[i]=temp%10; sum[i+1]+=temp/10; }
2019-05-15 12:13:53
590
原创 UVA 378 Intersecting Lines
UVA 378 Intersecting Lines 根据题意编代码即可 注意:分类讨论很可能因为过于混乱出错,因此,代码格式很重要(看得更加清楚),建议不用else CODE: #include<iostream> #include<cstdio> using namespace std; int n,x_1,y_1,x_2,y_2,x_3,y_3,x_4,y_...
2019-04-12 20:26:55
177
原创 UVA190 Circle Through Three Points
#include<iostream> #include<cmath> #include<cstdio> using namespace std; double ax,ay,bx,by,cx,cy,x,y,a,b,c,p,r,f; double A1,B1,A2,B2,C1,C2; int main() { while(cin>>ax&g...
2019-04-12 02:07:37
267
原创 UVA 438
#include<iostream> #include<cmath> #include<cstdio> using namespace std; const long double pi = 3.141592653589793; long double x1,y_1,x2,y2,x3,y3,a,b,c,p,r; int main() { //printf...
2019-04-11 20:29:20
284
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人
RSS订阅