- 博客(11)
- 收藏
- 关注

原创 问题 B: 【模拟】步步夺金
题目描述 Ivy所在的公司想推出一款手机APP“步步夺金”,该APP可以统计用户每天走路的步数,并给予相应的“金币”奖励。在用户的“金币”达到一定数量后,就可以在公司的网站上兑换一定的体育用品。 根据走路步数x奖励金币的规则如下: 1、每天的前1000步可领取0.3金币(若未达到1000步则领取数量为零),之后的每2000步能领取0.1金币。为了引导用户适量运动,每天领取的金币数量不能超过3。 2...
2020-04-03 00:07:48
924

原创 问题 H: Wanna go back home
题目描述 Snuke lives on an infinite two-dimensional plane. He is going on an N-day trip. At the beginning of Day 1, he is at home. His plan is described in a string S of length N. On Day i(1≤i≤N), he will...
2020-03-25 23:20:08
184
原创 动态申请内存
typedef struct news { char z[3001]; }news; news *a=(news *)malloc(200005*sizeof(news ))
2020-04-23 17:42:47
245
原创 c++高精度阶乘
string jiecheng(int n) { string str; if(n==1) { str="1"; return str; } else if(n==0) { str="1"; return str; } stringstream ss; ss&l...
2020-04-23 17:41:36
1014
原创 c++乘法
{ if((x.size()<y.size())||(x.size()==y.size()&&x.compare(y)<0)) { string s; s=x; x=y; y=s; } if(y.compare("0")==0) { string ss...
2020-04-23 17:41:01
4526
原创 高精度减法
string minus1(string x,string y) { int flag=0; string str; if(x.compare(y)==0) { str="0"; return str; } else if(x.size()<y.size()||(x.size()==y.size()&&...
2020-04-23 17:40:09
154
原创 高精度加法
string add(string x,string y) { int len1=x.size(); int len2=y.size(); int lenx=max(len1,len2); int lenn=min(len1,len2); reverse(x.begin(),x.end()); reverse(y.begin(),y.end()); ...
2020-04-23 17:39:29
146
原创 c++快速排序
sort(begin, end); 默认从小到大 sort(begin, end, cmp); sort(a + 1, a + 1 + n, cmp); sort(a, a + n, cmp); bool cmp(int x, int y) { return x > y; } struct Node { int x, y; std::string str; } /...
2020-04-23 17:32:11
139
原创 python文件的解码方式
编码名称 用途 utf8 所有语言 gbk 简体中文 utf8 所有语言 gb2312 简体中文 utf8 所有语言 gb18030 简体中文 big5 繁体中文 big5hkscs 繁体中文 代码如下 out=open('d:/分表.csv','w',newline='\n',encoding='gb18030') csv_write=csv.wr...
2020-04-23 16:57:34
600
原创 python数据爬取
#爬取部分 #一:对有标签的内容进行爬取 #打开文件 out=open(‘d:/分表.csv’,‘w’,newline=’\n’,encoding=‘gb18030’) csv_write=csv.writer(out,dialect=‘excel’) #数据爬取 for page in range (1,285): 略 xpath1=’//*[@id=“problemset”]/tbody’ d...
2020-04-23 16:45:55
383
原创 python网页动作模拟
#引入数据包 from selenium import webdriver from selenium.webdriver.common.action_chains import ActionChains from bs4 import BeautifulSoup import time import csv from collections import deque #模拟部分 #打开网站 dr...
2020-04-23 16:44:27
332
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人