题目链接[http://codeforces.com/problemset/problem/111/C] 题意:给出大小为N*M的图(1 ≤ n, m ≤ 40, n·m ≤ 40),每个图中有一个蜘蛛,每个蜘蛛有5种运动状态,不动,向上下左右移动.问蜘蛛如何移动才能使得图中的空地数最大,输出最大空地数. 题解:虽然(1 ≤ n, m ≤ 40, n·m ≤ 40),但是当(n<m)的时候可以swap(n,m),对结果是没有影响的.用一个二进制数表示每一行的每个位置的状态.最多有(1<<…
C. Petya and Spiders Little Petya loves training spiders. Petya has a board n × m in size. Each cell of the board initially has a spider sitting on it. After one second Petya chooses a certain action for each spider, and all of them humbly perform it…
/** * \file aes.h * * \brief AES block cipher * * Copyright (C) 2006-2010, Brainspark B.V. * * This file is part of PolarSSL (http://www.polarssl.org) * Lead Maintainer: Paul Bakker <polarssl_maintainer at polarssl.org> * * All rights reserved. * *…
B. Petya and Divisors Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/111/problem/B Description Little Petya loves looking for numbers' divisors. One day Petya came across the following problem: You are given n queries in t…