HDU3863:No Gambling
In the game, the two players take turns to choose two points to get connected by a stick. The two chosen points’ distance should be exactly one-unit length. The first player’s goal is to create a ‘bridge’ that connects a most left point and a most right point. The second player’s goal is to create a ‘bridge’ that connects a most top point and a most bottom point. Figure B shows a possible result (the first player won). In addition, the stick shouldn’t get crossed.
Now Flyvan will give the number N, and his two friends will play the game. Both of the two players will choose the best strategy. You can bet on one player, and if he wins the game, you’ll get twice money you bet~
Since you are a talented programmer, you surely won’t just do gambling. Please write a program to find out the player who you should bet on. As Oregon Maple is elder, he will always play first.
-1
第一个人从左到右连接蓝点
第二个人从上到下连接红点
轮流进行
看最后谁的线最多则赢
我们可以发现,只要是先手,那么连的线一定是最多了,因此代码也就只有短短的几行
#include <stdio.h>
int main()
{
int n;
while(scanf("%d",&n),n+1)
puts("I bet on Oregon Maple~");
return 0;
}
HDU3863:No Gambling的更多相关文章
- java web 开发三剑客 -------电子书
Internet,人们通常称为因特网,是当今世界上覆盖面最大和应用最广泛的网络.根据英语构词法,Internet是Inter + net,Inter-作为前缀在英语中表示“在一起,交互”,由此可知In ...
- 所有selenium相关的库
通过爬虫 获取 官方文档库 如果想获取 相应的库 修改对应配置即可 代码如下 from urllib.parse import urljoin import requests from lxml im ...
- CodeForces - 662A:Gambling Nim (求有多少个子集其异或为S)(占位)
As you know, the game of "Nim" is played with n piles of stones, where the i-th pile initi ...
- 【BZOJ5197】Gambling Guide (最短路,期望)
[BZOJ5197]Gambling Guide (最短路,期望) 题面 BZOJ权限题 洛谷 题解 假设我们求出了每个点的期望,那么对于一个点,只有向期望更小的点移动的时候才会更新答案. 即转移是: ...
- 每日英语:How Often Do Gamblers Really Win?
The casino billboards lining America's roadways tantalize with the lure of riches. 'Easy Street. It' ...
- 【CF662A】Gambling Nim 线性基
[CF662A]Gambling Nim 题意:n长卡牌,第i张卡牌正面的数字是$a_i$,反面的数字是$b_i$,每张卡牌等概率为正面朝上或反面朝上.现在Alice和Bob要用每张卡牌朝上的数字玩N ...
- zoj 3356 Football Gambling II【枚举+精度问题】
题目: http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3356 http://acm.hust.edu.cn/vjudge/ ...
- iOS审核策略重磅更新:Guideline 2.1批量拒审
自从进入了2018年,大量应用在AppStore提交审核后,都直接给大家回复了个新春大礼包 Guideline 2.1 - Information Needed. 而大部分的应用,特别是金融类相关AP ...
- [BZOJ5197] [CERC2017]Gambling Guide
[BZOJ5197] [CERC2017]Gambling Guide 题目链接 https://www.lydsy.com/JudgeOnline/problem.php?id=5197 Solut ...
随机推荐
- CentOS 删除自带的OpenJDK 和 安装SunJDK
[root@WX32 local]# java -version java version "1.6.0" OpenJDK Runtime Environment (build - ...
- Gallery平滑移动
看了些网上的方法弄了下平滑移动的效果,虽说最后是实现了,实现后发现也不是我想要的效果,对于我幸苦写过的代码先存放在这上面了 package com.layout; import android.con ...
- javascript数组去重算法-----4(另一种写法)
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...
- javascript数组去重算法-----4
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...
- linux 获取文件系统信息(磁盘信息)
源代码例如以下: #include <stdio.h> #include <stdlib.h> #include <string.h> #include <s ...
- mac 版本号控制工具SmartSVN7.5.4(破解版)
SmartSVN7.5.4和破解工具,下载地址:http://download.csdn.net/detail/pearlhuzhu/7407319 操作步骤: 1.在MAC上选中smartsvn-m ...
- <转>ASP.NET学习笔记之理解MVC底层运行机制
ASP.NET MVC架构与实战系列之一:理解MVC底层运行机制 今天,我将开启一个崭新的话题:ASP.NET MVC框架的探讨.首先,我们回顾一下ASP.NET Web Form技术与ASP.NET ...
- 在OS X 10.10系统上安装Navicat Premium中文破解版11.0.16教程
此链接是Navicat Premium中文破解版11.0.16安装包里面并带有中文汉化包 http://pan.baidu.com/s/1ntjz6HF#path=%252F 一.Navicat Pr ...
- mysql批量上传数据
private object BlubckMysql(List<xiaoyao_blogs_pictureModel> list, string connect) { var sqllis ...
- hadoop hdfs 一些命令记录
1.列出目录下的对象:hadoop fs -ls /lib 2.统计文件行数:hadoop fs -cat /文件* | wc -l 3.统计文件或者目录大小:hadoop fs -count /l ...