# 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这种输入就是缓冲流的使用

  判断奇偶

    模2

错误

  奇数

    注意题目中的数据input,明显是包含奇数的

Double Strings Solved Problem code: DOUBLE的更多相关文章

  1. Factorial Solved Problem code: FCTRL

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

  2. ATM Solved Problem code: HS08TES

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

  3. Small factorials Solved Problem code: FCTRL2

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

  4. Enormous Input Test Solved Problem code: INTEST

    import sys import psyco #一键优化库 psyco.full() def main(): n, k = map(int, sys.stdin.readline().strip() ...

  5. [转]Passing Managed Structures With Strings To Unmanaged Code Part 3

    1. Introduction. 1.1 In part 1 of this series of blogs we studied how to pass a managed structure (w ...

  6. [转]Passing Managed Structures With Strings To Unmanaged Code Part 2

    1. Introduction. 1.1 In part 1 of this series of blogs we studied how to pass a managed structure (w ...

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

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

  8. Gym 101194E / UVALive 7901 - Ice Cream Tower - [数学+long double][2016 EC-Final Problem E]

    题目链接: http://codeforces.com/gym/101194/attachments https://icpcarchive.ecs.baylor.edu/index.php?opti ...

  9. CSU 1506 Problem D: Double Shortest Paths(最小费用最大流)

    题意:2个人从1走到n,假设一条路第一次走则是价值di,假设第二次还走这条路则须要价值di+ai,要你输出2个人到达终点的最小价值! 太水了!一条边建2次就OK了.第一次价值为di,第二次为ai+di ...

随机推荐

  1. setAnimationStyle实现的popwindow显示消失的动画效果

    摘要 popwindow通过setAnimationStyle(int animationStyle)函数来设置动画效果 android:windowEnterAnimation表示进入窗口动画 an ...

  2. LeetCode_Minimum Window Substring

    Given a string S and a string T, find the minimum window in S which will contain all the characters ...

  3. WCF的基本知识-仅Http绑定的认知

    有关WCF,这3个字母代表的含义,鄙人不会在此细说.喜欢或者不喜欢的,大家勿喷. 入正题,微软从设计.net框架开始,就一直着力于解决程序间的互通信问题.从古老的套接字(Socket)通信到后来的Re ...

  4. TextWatcher编辑框监听器

    TextWatcher tw = new TextWatcher() { @Override public void beforeTextChanged(CharSequence s, int sta ...

  5. OpenJTAG+Eclipse 3.5+GDB+Mini2440图文教程

    OpenJTAG+Eclipse 3.5+GDB+Mini2440图文教程 OpenJTAG与JLink的区别比较: 相同点:都同时具备USB转JTAG.USB转串口功能 差别: 1. 操作系统: O ...

  6. Android 开机启动通知

    效果图: 学习: 1.静态注册实现开机启动 <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLET ...

  7. Visual Studio 2012 编译C++显示cl命令

    为了用newlisp来实现VC编译,以便用我的Emacs开发VC程序,而不需要再打开VS 2012, 需要自己实现命令行的编译.我不需要nmake,因为我想直接了解VC编译器,以便今后更好的驾驭它. ...

  8. c语言验证哥德巴赫猜想(从4开始 一个偶数由两个质数之和)

    #include <stdio.h> #include <stdlib.h> #include <math.h> int isit(int num) { int i ...

  9. python使用deque实现fifo(先进先出)

    #2:deque还提供了append 和pop方法,在序列的两端都能以相同的速度执行#例子2:使用deque实现fifo(先进先出),如下:from collections import dequei ...

  10. (转)iOS Wow体验 - 第四章 - 为应用的上下文环境而设计

    本文是<iOS Wow Factor:Apps and UX Design Techniques for iPhone and iPad>第四章译文精选,其余章节将陆续放出.上一篇:Wow ...