深夜无聊,cf上刷水题练python... 结果发现是被练好么... 1A Theater Square #!/usr/bin/env python import math n, m, a = map(int, raw_input().split())print int(math.ceil(n*1.0/a)*math.ceil(m*1.0/a))
1,假设函数f(n)是自然数1,2,3,...,n的所有数的异或,即f(n)=1^2^3^...^n, 那么,任意的n(n为自然数),我们能够很快的计算出f(n)的值 if n == 4*m, then f(n) = n else if n == 4*m + 1, then f(n) = 1 else if n == 4*m + 2, then f(n) = n+1 else n