ATM Solved Problem code: HS08TES】的更多相关文章

# ATM import sys withdraw, balance = map(float, sys.stdin.readline().strip().split()) # strip()用法去除结尾的\n符号 if int(withdraw) % 5 != 0 or balance < (withdraw + 0.5): # 1.注意手续费,缺少手续费也不能取 2.xy0~2000是测试值要求,不用判断 print("%.2f" % balance) else: print(…
import sys #import psyco #很奇怪,这题用psyco就runtime error #psyco.full() def z(n): #这个应该是技巧的一种算法 r = 0 while 5 <= n: n /= 5 r += n return r def main(): n = int(sys.stdin.readline()) for t in sys.stdin: #这种循环输入一点问题也没 print z(int(t)) #输入的是String, 一定要记得int转化…
# Fuking silly, OTZ.... import sys def main(): n = int(raw_input()) for num in sys.stdin: if int(num) % 2 == 0: print int(num) else: # 千万不要忘了考虑奇数的情况 print int(num) -1 main() 学习 化繁为简 逻辑上的理解正确和化繁为简,是刷OJ的第一步,比如本题,一堆废话,其实水爆 输入缓冲流 stdin这种输入就是缓冲流的使用 判断奇偶 模…
import sys def fact(n): final = n while n > 1: final *= n - 1 n -= 1 return final #逻辑严谨,不要忘了return def main(): t = int(sys.stdin.readline()) for n in sys.stdin: print fact(int(n)) #读取String的转换是一个常见的坑 main() //第二种,利用现成的库 from math import factorial #熟悉…
import sys import psyco #一键优化库 psyco.full() def main(): n, k = map(int, sys.stdin.readline().strip().split()) #两位数输入的复用 count = 0 for t in sys.stdin: #注意这个for循环方式 if int(t) % k == 0: count += 1 print '%d' % count #注意格式输出 main() #写成函数的格式是一个良好的习惯 学到 py…
Cooking Schedule Problem Code: SCHEDULE Chef is a well-known chef, and everyone wishes to taste his dishes. As you might know, cooking is not an easy job at all and cooking everyday makes the chef very tired. So, Chef has decided to give himself some…
import sys def count_holes(letter): hole_2 = ['A', 'D', 'O', 'P', 'Q', 'R'] if letter == 'B': return 2 elif letter in hole_2: return 1 else: return 0 def main(): n = int(sys.stdin.readline()) for t in sys.stdin: num = 0 for l in t[:-1]: num += count_…
'''def count_lead(first, second): if first > second: return 1, first - second elif first == second: # 题目中没有说明相等的情况 return 0, 0 else: return 2, second - first''' def main(): n = int(raw_input()) lead = 0 winner = 0 # 有些初始值不放置,判断不成立而输出时,为空了就 num1 = 0 n…
def heap_sort(ary): n = len(ary) first = int(n / 2 - 1) for start in range(first, -1, -1): # 3~0 revese max_heapify(ary, start, n - 1) # from start for end in range(n - 1, 0, -1): ary[end], ary[0] = ary[0], ary[end] max_heapify(ary, 0, end - 1) retur…
原文地址:http://www.tomcatexpert.com/blog/2012/12/05/use-spring-insight-developer-analyze-code-install-it-tomcat-and-extend-it-plugins People are still discovering the benefits of the free tool from VMware SpringSource, called Spring Insight Developer. T…
地址:http://codeforces.com/contest/807/problem/D 题目: D. Dynamic Problem Scoring time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Vasya and Petya take part in a Codeforces round. The round las…
D. Dynamic Problem Scoring time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Vasya and Petya take part in a Codeforces round. The round lasts for two hours and contains five problems. For th…
考虑记\(f_{i,j,k}\)为\(k\)次操作后,\(i,j\)位置被调换的概率. 那么我们考虑枚举我们要算的答案即\((x,y)\). 那么有\(\frac{n * (n + 1)}{2}\)种调换顺序. 以此分类讨论: 一:不相交: 对答案不产生影响. 二:包含 因为是反转操作,考虑枚举枚举翻转移动的距离,从\(f_{i + q,j + q,k - 1}\)转移过来. 三:端点相交 同样考虑枚举反转距离 ,从\(f_{i + q,j,k - 1}\)还有\(f_{i,j + q,k -…
Recently Kaggle hosted a competition on the CIFAR-10 dataset. The CIFAR-10 dataset consists of 60k 32x32 colour images in 10 classes. This dataset was collected by AlexKrizhevsky, Vinod Nair, and Geoffrey Hinton. Many contestants used convolutional n…
@http://www-cs-faculty.stanford.edu/people/karpathy/cvpr2015papers/ CVPR 2015 papers (in nicer format than this) maintained by @karpathy NEW: This year I also embedded the (1,2-gram) tfidf vectors of all papers with t-sne and placed them in an interf…
http://www.fxguide.com/featured/pixars-opensubdiv-v2-a-detailed-look/ Pixar’s OpenSubdiv V2: A detailed look By Mike Seymour September 18, 2013 Subdivision is key modeling tool that allows greater accuracy and the OpenSubdiv project aims to standardi…
2818: Gcd Time Limit: 10 Sec  Memory Limit: 256 MBSubmit: 1566  Solved: 691[Submit][Status] Description 给定整数N,求1<=x,y<=N且Gcd(x,y)为素数的数对(x,y)有多少对. Input 一个整数N Output 如题 Sample Input 4 Sample Output 4 HINT hint 对于样例(2,2),(2,4),(3,3),(4,2) 1<=N<=…
2107: Spoj2832 Find The Determinant III Time Limit: 1 Sec  Memory Limit: 259 MBSubmit: 154  Solved: 46[Submit][Status][Discuss] Description Problem code: DETER3 Given a NxN matrix A, find the Determinant of A % P. 给出一个尺寸为N×N的整数方阵A(N≤200),要求求出|A|%P的值(…
JTAG Finder Figuring out the JTAG Pinouts on a Device is usually the most time-consuming and frustrating process and Finding the pinouts for these ports allows you to access with correct JTAG Devices likeGPG ORT,  and JTAG Finder helps you to get sta…
20162314 2017-2018-1 <Program Design & Data Structures>Learning Summary Of The First Week Summary of teaching materials Algorithm analysis is the basic project of the computer science. Increasing function prove that the utilization of the time a…
A Simple Makefile Tutorial A Simple Makefile Tutorial: http://www.cs.colby.edu/maxwell/courses/tutorials/maketutor/ Makefiles are a simple way to organize code compilation. This tutorial does not even scratch the surface of what is possible using mak…
http://sealedabstract.com/rants/why-mobile-web-apps-are-slow/ I’ve had an unusual number of interesting conversations spin out of my previous article documenting that mobile web apps are slow.  This has sparked some discussion, both online and IRL.  …
Leetcode 简略题解 - 共567题     写在开头:我作为一个老实人,一向非常反感骗赞.收智商税两种行为.前几天看到不止两三位用户说自己辛苦写了干货,结果收藏数是点赞数的三倍有余,感觉自己的无偿付出连认同都得不到,很是失望.明白人都知道这是潜水伸手党的锅.但同时,截止写这段话时,我发现这篇Leetcode简略(得不能再简略的)题解得到了一千多赞,三千多收藏.所以,在我不向任何人做任何广告.收任何费用的前提下,麻烦在收藏的同时,顺手点个赞(对只收藏不点赞的行为表示明确鄙视).如果连点一个…
A complex 16-Level XSS Challenge, held in summer 2014 (+1 Hidden Level) Index Level 0 Level 1 Level 2 Level 3 Level 4 Level 5 Level 6 Level 7 Level 8 Level 9 Level 10 Level 11 Level 12 Level 13 Level 14 Level 15 Hidden Level Rules Call prompt(1) to w…
A Simple Makefile Tutorial Makefiles are a simple way to organize code compilation. This tutorial does not even scratch the surface of what is possible using make, but is intended as a starters guide so that you can quickly and easily create your own…
Simple SDK for capturing, recording and streaming video and audio from web-cams on Windows OS by Windows Media Foundation. Download CaptureManagerSDK-1.0.0.zip - 1.1 MB Download CaptureManagerSDK-1.1.0.zip - 1.1 MB Download CaptureManagerSDK-1.2.0_be…
How to use context.Set and context.Entry, which ships with EF4.1 ? Hello, I am trying to implement a generic repository as explained on the following link :- http://www.asp.net/entity-framework/tutorials/implementing-the-repository-and-unit-of-work-p…
3871. GCD Extreme Problem code: GCDEX Given the value of N, you will have to find the value of G. The meaning of G is given in the following code G=0; for(k=i;k< N;k++) for(j=i+1;j<=N;j++) { G+=gcd(k,j); } /*Here gcd() is a function that finds the g…
Problem code: LCMSUM Given n, calculate the sum LCM(1,n) + LCM(2,n) + .. + LCM(n,n), where LCM(i,n) denotes the Least Common Multiple of the integers i and n. Input The first line contains T the number of test cases. Each of the next T lines contain…
SPOJ Problem Set (classical) 7001. Visible Lattice Points Problem code: VLATTICE Consider a N*N*N lattice. One corner is at (0,0,0) and the opposite one is at (N,N,N). How many lattice points are visible from corner at (0,0,0) ? A point X is visible…