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() #写成函数的格式是一个良好的习惯

学到

  python强大

    有一键算法优化的库

  复用

    map这种

  循环控制

  格式输出

  函数构成

错误

  ++和C里面的不一样

  

Enormous Input Test Solved Problem code: INTEST的更多相关文章

  1. Double Strings Solved Problem code: DOUBLE

    # Fuking silly, OTZ.... import sys def main(): n = int(raw_input()) for num in sys.stdin: if int(num ...

  2. Factorial Solved Problem code: FCTRL

    import sys #import psyco #很奇怪,这题用psyco就runtime error #psyco.full() def z(n): #这个应该是技巧的一种算法 r = 0 whi ...

  3. ATM Solved Problem code: HS08TES

    # ATM import sys withdraw, balance = map(float, sys.stdin.readline().strip().split()) # strip()用法去除结 ...

  4. Small factorials Solved Problem code: FCTRL2

    import sys def fact(n): final = n while n > 1: final *= n - 1 n -= 1 return final #逻辑严谨,不要忘了retur ...

  5. 【CodeChef】Enormous Input Test

    The purpose of this problem is to verify whether the method you are using to read input data is suff ...

  6. Cooking Schedule Problem Code: SCHEDULE(优先队列)

    Cooking Schedule Problem Code: SCHEDULE Chef is a well-known chef, and everyone wishes to taste his ...

  7. Holes in the text Add problem to Todo list Problem code: HOLES

    import sys def count_holes(letter): hole_2 = ['A', 'D', 'O', 'P', 'Q', 'R'] if letter == 'B': return ...

  8. The Lead Game Add problem to Todo list Problem code: TLG

    '''def count_lead(first, second): if first > second: return 1, first - second elif first == secon ...

  9. Turbo Sort Add problem to Todo list Problem code: TSORT

    def heap_sort(ary): n = len(ary) first = int(n / 2 - 1) for start in range(first, -1, -1): # 3~0 rev ...

随机推荐

  1. MAC下用OPENSSL生成公钥和私钥

    MAC OS自带了OpenSSL,所以不用去编译那一坨跟SHIT一样的源码.直接在命令行里使用OPENSSL就可以. 打开命令行工具,然后输入 openssl打开openssl,接着只要三句命令就可以 ...

  2. List是线程安全的吗?如果不是该怎么办呢?安全的List对性能的影响有多大呢?

    测试条件: 开启2个并行执行任务,往同一个list对象写入值 测试代码: ; static List<int> list = new List<int>(); static v ...

  3. c# List集合排序

    using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.We ...

  4. LeetCode_Jump Game

    Given an array of non-negative integers, you are initially positioned at the first index of the arra ...

  5. C# 多线程的自动管理(线程池) 基于Task的方式

    C# 多线程的自动管理(线程池) 在多线程的程序中,经常会出现两种情况:    1. 应用程序中线程把大部分的时间花费在等待状态,等待某个事件发生,然后给予响应.这一般使用 ThreadPool(线程 ...

  6. FZU 1856 The Troop (JAVA高精度)

    Problem 1856 The Troop Accept: 72    Submit: 245Time Limit: 1000 mSec    Memory Limit : 32768 KB Pro ...

  7. hdu 4355 Party All the Time(三分搜索)

    Problem Description In the Dark forest, there is a Fairy kingdom where all the spirits will go toget ...

  8. hdu 1595 find the longest of the shortest(dijkstra)

    Problem Description Marica is very angry with Mirko because he found a new girlfriend and she seeks ...

  9. No module named MYSQLdb 问题解决

    问题描述: 报错:ImportError: No module named MySQLdb 对于不同的系统和程序有如下的解决方法: easy_install mysql-python (mix os) ...

  10. 格而知之7:我所理解的Runtime(2)

    消息发送(Messaging) 8.以上便是runtime相关的一些数据结构,接下来我们回看一开始的疑问: objc_msgSend()函数在执行的过程中是如何找到对应的类,找到对应的方法实现的呢? ...