题意:问 nnn 个手势的石头剪刀布游戏是否能保证出每种手势胜率都一样。

析:当每种手势的攻防个数完全相等才能保证平衡,所以容易得出 nnn 是奇数时游戏平衡,否则不平衡。

也就是说打败 i 的和 i 打败的必须一样多,也就是说n-1 是个偶数。

代码如下:

#pragma comment(linker, "/STACK:1024000000,1024000000")
#include <cstdio>
#include <string>
#include <cstdlib>
#include <cmath>
#include <iostream>
#include <cstring>
#include <set>
#include <queue>
#include <algorithm>
#include <vector>
#include <map>
#include <cctype>
#include <cmath>
#include <stack>
#define freopenr freopen("in.txt", "r", stdin)
#define freopenw freopen("out.txt", "w", stdout)
using namespace std; typedef long long LL;
typedef pair<int, int> P;
const int INF = 0x3f3f3f3f;
const double inf = 0x3f3f3f3f3f3f;
const double PI = acos(-1.0);
const double eps = 1e-8;
const int maxn = 1e3 + 5;
const int mod = 1e9 + 7;
const int dr[] = {-1, 0, 1, 0};
const int dc[] = {0, 1, 0, -1};
const char *de[] = {"0000", "0001", "0010", "0011", "0100", "0101", "0110", "0111", "1000", "1001", "1010", "1011", "1100", "1101", "1110", "1111"};
int n, m;
const int mon[] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
const int monn[] = {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
inline int Min(int a, int b){ return a < b ? a : b; }
inline int Max(int a, int b){ return a > b ? a : b; }
inline LL Min(LL a, LL b){ return a < b ? a : b; }
inline LL Max(LL a, LL b){ return a > b ? a : b; }
inline bool is_in(int r, int c){
return r >= 0 && r < n && c >= 0 && c < m;
} int main(){
int T; cin >> T;
while(T--){
scanf("%d", &n);
if(n & 1) printf("Balanced\n");
else printf("Bad\n");
}
return 0;
}

HDU 5882 Balanced Game (水题)的更多相关文章

  1. hdu 1106:排序(水题,字符串处理 + 排序)

    排序 Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submissi ...

  2. HDU 4950 Monster (水题)

    Monster 题目链接: http://acm.hust.edu.cn/vjudge/contest/123554#problem/I Description Teacher Mai has a k ...

  3. HDU 4813 Hard Code 水题

    Hard Code Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://acm.hust.edu.cn/vjudge/contest/view.act ...

  4. HDU 4593 H - Robot 水题

    H - RobotTime Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://acm.hust.edu.cn/vjudge/contest/view.act ...

  5. HDOJ/HDU 2560 Buildings(嗯~水题)

    Problem Description We divide the HZNU Campus into N*M grids. As you can see from the picture below, ...

  6. HDOJ(HDU) 1859 最小长方形(水题、、)

    Problem Description 给定一系列2维平面点的坐标(x, y),其中x和y均为整数,要求用一个最小的长方形框将所有点框在内.长方形框的边分别平行于x和y坐标轴,点落在边上也算是被框在内 ...

  7. HDU - 1716 排列2 水题

    排列2 Time Limit: 1000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submis ...

  8. HDU—2021-发工资咯(水题,有点贪心的思想)

    作为杭电的老师,最盼望的日子就是每月的8号了,因为这一天是发工资的日子,养家糊口就靠它了,呵呵  但是对于学校财务处的工作人员来说,这一天则是很忙碌的一天,财务处的小胡老师最近就在考虑一个问题:如果每 ...

  9. HDU 5882 Balanced Game

    Balanced Game Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Tot ...

随机推荐

  1. ASP.NETCore使用AutoFac依赖注入

    原文:ASP.NETCore使用AutoFac依赖注入 实现代码 1.新建接口类:IRepository.cs,规范各个操作类的都有那些方法,方便管理. using System; using Sys ...

  2. 在windows中增加linux命令

    在windows中增加linux命令 无它,复用git中的即可:

  3. 转:linux下ip修改与域名解析查看等

    转自: http://www.justwinit.cn/post/7038/ IP:     ifconfiggateway:172.16.0.254 [root@localhost ~]# nets ...

  4. Bootstrap全局CSS样式之button和图片

    .btn-default--button的默认样式. .btn-primary--button的首选样式: .btn-success--button的成功样式: .btn-info--button的一 ...

  5. javascript读取和改动原型特别须要注意的事儿,由于原型的读写不具有对等性

    对于从原型对象继承而来的成员,其读和写具有内在的不正确等性.比方有一个对象A,假设它的原型对象是B.B的原型对象是null.假设我们须要读取A对象的name属性值,那么JS会优先在A中查找.假设找到了 ...

  6. Linux启动过程笔记

    Linux启动过程 1.启动流程(BIOS->MBR:Boot Code->引导GRUB->载入内核->运行init->runlevel) 2./boot/grub/下有 ...

  7. Qt、C++ 简易计算器

    Qt.C++实现简易计算器: 以下内容是我实现这个简易计算器整个过程,其中包括我对如何实现这个功能的思考.中途遇到的问题.走过的弯路 整个实现从易到难,计算器功能从简单到复杂,最开始设计的整个实现步骤 ...

  8. u-boot简单学习笔记(二)——AR9331 uboot.lds分析

    最开始系统上电后 从uboot.lds开始引导 OUTPUT_FORMAT("elf32-tradbigmips", "elf32-tradbigmips", ...

  9. chmod|chown|chgrp和用法和区别

    1.chgrp(改变文件所属用户组) chgrp 用户组   文件名   ###就是这个格了.如果整个目录下的都改,则加-R参数用于递归. 如:chgrp -R   user smb.conf 2.c ...

  10. SLG, 菱形格子的算法.(递归版

    class GeoPoint{ public: int x; int y; public: bool operator == (const GeoPoint& p){ return p.x = ...