HDU 5660 jrMz and angles (暴力枚举)】的更多相关文章

jrMz and angles 题目链接: http://acm.hust.edu.cn/vjudge/contest/123316#problem/E Description jrMz has two types of angles, one type of angle is an interior angle of -sided regular polygon, and the other type of angle is an interior angle of -sided regula…
题目 这是一道可以暴力枚举的水题. //以下两个都可以ac,其实差不多一样,呵呵 //1: //4 wei shu #include<stdio.h> struct tt { ],b[],c[]; }e[]; int main() { ],mark[],yi,flag,a1,a2,a3,a4; while(scanf("%d",&n),n) { ;i<n;i++) { scanf("%s%s%s",e[i].a,e[i].b,e[i].c)…
Crazy Tank Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 4562    Accepted Submission(s): 902 Problem Description Crazy Tank was a famous game about ten years ago. Every child liked it. Time f…
又一发吐血ac,,,再次明白了用函数(代码重用)和思路清晰的重要性. 11779687 2014-10-02 20:57:53 Accepted 4770 0MS 496K 2976 B G++ czy Lights Against Dudely Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 1360    Accepted Subm…
HDU 4930 Fighting the Landlords 题目链接 题意:就是题中那几种牌型.假设先手能一步走完.或者一步让后手无法管上,就赢 思路:先枚举出两个人全部可能的牌型的最大值.然后再去推断就可以 代码: #include <cstdio> #include <cstring> #include <algorithm> using namespace std; struct Player { int rank[15]; } p1, p2; int t,…
题意:给定 13 张麻将牌,问你是不是“听”牌,如果是输出“听”哪张. 析:这个题,很明显的暴力,就是在原来的基础上再放上一张牌,看看是不是能胡,想法很简单,也比较好实现,结果就是TLE,一直TLE,这不科学啊... 好不容易写出来的,竟然TLE...心痛.就是先确定一个将牌,然后再对刻子和顺子进行分析,其实是要剪枝的,就是在如果有1张或者两张牌,而你又不能构成刻子的时候,就要返回false,因为这就已经没解了. 这一个剪枝,就AC了. 代码如下: #pragma comment(linker,…
题意:... 析:我们可以知道,a1+a2=b1,那么我们可以枚举a1,那么a2就有了,并且a1+a3=b2,所以a3就有了,我们再从把里面的剩下的数两两相加,并从b数组中去掉, 那么剩下的最小的就是a4,然后依次可以求出a5,a6....由于a最大才是5000,并且保证有唯一解,那么找到一个就直接退出. 代码如下: #pragma comment(linker, "/STACK:1024000000,1024000000") #include <cstdio> #incl…
Problem Description Let L denote the number of 1s in integer D’s binary representation. Given two integers S1 and S2, we call D a WYH number if S1≤L≤S2. With a given D, we would like to find the next WYH number Y, which is JUST larger than D. In othe…
题目链接:pid=4462">传送门 题意:一个n*n的区域,有m个位置是能够放稻草人的.其余都是玉米.对于每一个位置(x,y)所放稻草人都有个作用范围ri, 即abs(x-i)+abs(y-j)<=r,(i,j)为作用范围内.问至少要在几个位置上放稻草人,才干覆盖全部的玉米,若不可能则输出-1. 有一个trick,就是放稻草人的位置不用被覆盖 eg: input: 2 4 1 1 1 2 2 1 2 2 0 0 0 0 output: 0 0 代码例如以下: #include &l…
Beautiful Now Time Limit: 5000/2500 MS (Java/Others)    Memory Limit: 262144/262144 K (Java/Others)Total Submission(s): 1876    Accepted Submission(s): 707 Problem Description Anton has a positive integer n, however, it quite looks like a mess, so he…