- 博客(19)
- 收藏
- 关注
原创 calculator 计算器 re模块运用
最近几周迷上了Python,看了几天的Python后,尝试着写了一个计算器,经过几个小时的硬怼 总算是用正则表达式实现了计算器符合运算的功能。只要会了正则表达式,那就没啥难的了,主要还是正则的运用。只实现了计算,没写判断输入的是否合法,以后有心情的话再加吧。 code:# @Time : 2018/6/10 17:34# @Author : 非人类浩import redef ...
2018-06-10 21:01:38 870
原创 Ubuntu下,pycharm的快捷方式的创建
一: 在桌面创建一个文件:pycharm.desktop二: 打开创建的文件:pycharm.desktop 输入如下代码:[Desktop Entry]Version=1.0Type=ApplicationName=PycharmIcon=/home/du/Documents/pycharm-community-2017.3.3/bin/pycharm.png...
2018-05-17 23:17:42 323
转载 最大子阵
问题描述 给定一个n*m的矩阵A,求A中的一个非空子矩阵,使这个子矩阵中的元素和最大。 其中,A的子矩阵指在A中行和列均连续的一块。 输入格式 输入的第一行包含两个整数n, m,分别表示矩阵A的行数和列数。 接下来n行,每行m个整数,表示矩阵A。 输出格式 输出一行,包含一个整数,表示A中最大的子矩阵中的元素和。 样例输入 3 3 -1 -4 3 3 4 ...
2018-03-12 15:54:34 253
原创 7-1 四平方和(qdulq)(暴力枚举+小技巧)
四平方和定理,又称为拉格朗日定理:每个正整数都可以表示为至多4个正整数的平方和。如果把0包括进去,就正好可以表示为4个数的平方和。比如:5 = 0^2 + 0^2 + 1^2 + 2^2 7 = 1^2 + 1^2 + 1^2 + 2^2 (^符号表示乘方的意思) 对于一个给定的正整数,可能存在多种平方和的表示法。要求你对4个数排序:0 并对所有的可能表示法按 a
2018-02-06 14:11:27 293
原创 模拟时钟
mooc视频学习时,照着视频手打,非原创from turtle import *from datetime import *##绘制表盘def SetupClock(radius): #建立标的外框 reset() pensize(7) for i in range(60): Skip(radius) if i%5==0:
2018-02-05 14:22:03 770 2
原创 C - Another Problem on Strings CodeForces - 165C
A string is binary, if it consists only of characters “0” and “1”.String v is a substring of string w if it has a non-zero length and can be read starting from some position in string w. For example
2018-02-03 16:00:04 204
原创 B - Burning Midnight Oil CodeForces - 165B
One day a highly important task was commissioned to Vasya — writing a program in a night. The program consists of n lines of code. Vasya is already exhausted, so he works like that: first he writes v
2018-02-01 19:42:46 227
原创 E - ABC086C
AtCoDeer the deer is going on a trip in a two-dimensional plane. In his plan, he will depart from point (0,0) at time 0, then for each i between 1 and N (inclusive), he will visit point (xi,yi) at tim
2018-02-01 15:33:40 490
原创 1051. 复数乘法 (15)
复数乘法 (15)时间限制 400 ms 内存限制 65536 kB 代码长度限制 8000 B 判题程序 Standard 作者 CHEN, Yue 复数可以写成(A + Bi)的常规形式,其中A是实部,B是虚部,i是虚数单位,满足i2 = -1;也可以写成极坐标下的指数形式(R*e(Pi)),其中R是复数模,P是辐角,i是虚数单位,其等价于三角形式 R(cos(P)
2018-01-30 13:29:41 346
原创 1010. 一元多项式求导 (25)
一元多项式求导 (25)时间限制 400 ms 内存限制 65536 kB 代码长度限制 8000 B 判题程序 Standard 设计函数求一元多项式的导数。(注:xn(n为整数)的一阶导数为n*xn-1。)输入格式:以指数递降方式输入多项式非零项系数和指数(绝对值均为不超过1000的整数)。数字间以空格分隔。输出格式:以与输入相同的格式输出导数多项式非零项的系数和
2018-01-29 20:52:41 217
原创 HDU - 1236
今天的上机考试虽然有实时的Ranklist,但上面的排名只是根据完成的题数排序,没有考虑 每题的分值,所以并不是最后的排名。给定录取分数线,请你写程序找出最后通过分数线的 考生,并将他们的成绩按降序打印。 Input 测试输入包含若干场考试的信息。每场考试信息的第1行给出考生人数N ( 0 名考生的准考证号(长度不超过20的字符串)、该生解决的题目总数m、以及这m道题的题号
2018-01-27 16:50:26 256
翻译 New Year and Buggy Bot
Bob programmed a robot to navigate through a 2d maze.The maze has some obstacles. Empty cells are denoted by the character ‘.’, where obstacles are denoted by ‘#’.There is a single robot in the ma
2018-01-26 19:47:20 288
原创 Browser
Luba is surfing the Internet. She currently has n opened tabs in her browser, indexed from 1 to n from left to right. The mouse cursor is currently located at the pos-th tab. Luba needs to use the tab
2018-01-26 19:41:41 384
原创 Permute Digits
D - Permute Digits You are given two positive integer numbers a and b. Permute (change order) of the digits of a to construct maximal number not exceeding b. No number in input and/or output can sta
2018-01-26 17:54:34 310
原创 POJ - 2386 Lake Counting
Lake Counting Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 39457 Accepted: 19558 DescriptionDue to recent rains, water has pooled in various places in Farmer John’s fiel
2018-01-24 13:45:23 203
原创 三部排序
一般的排序有许多经典算法,如快速排序、希尔排序等。但实际应用时,经常会或多或少有一些特殊的要求。我们没必要套用那些经典算法,可以根据实际情况建立更好的解法。比如,对一个整型数组中的数字进行分类排序:使得负数都靠左端,正数都靠右端,0在中部。注意问题的特点是:负数区域和正数区域内并不要求有序。可以利用这个特点通过1次线性扫描就结束战斗!!以下的程序实现了该目标。其中x指向待排序的
2018-01-23 21:07:12 257
原创 7-1 Huffuman树(qdulq)(40 分)
“7-1 Huffuman树(qdulq)(40 分) Huffman树在编码中有着广泛的应用。在这里,我们只关心Huffman树的构造过程。给出一列数{pi}={p0, p1, …, pn-1},用这列数构造Huffman树的过程如下: 1. 找到{pi}中最小的两个数,设为pa和pb,将pa和pb从{pi}中删除掉,然后将它们的和加入到{pi}中。这个过程的费用记为pa + p
2018-01-23 18:51:52 278
原创 7-2 Sine之舞(qdulq)(40 分)
7-2 Sine之舞(qdulq)(40 分)最近FJ为他的奶牛们开设了数学分析课,FJ知道若要学好这门课,必须有一个好的三角函数基本功。所以他准备和奶牛们做一个“Sine之舞”的游戏,寓教于乐,提高奶牛们的计算能力。 不妨设 An=sin(1–sin(2+sin(3–sin(4+...sin(n))...) Sn=(...(A1+n)A2+n-1)A3+...+
2018-01-23 18:33:42 272
转载 PTA的6-10 二叉树的遍历
#include <stdio.h>#include <stdlib.h>typedef char ElementType;typedef struct TNode *Position;typedef Position BinTree;struct TNode{ ElementType Data; BinTree Left; BinTr...
2017-11-17 16:12:49 1246
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人