当前位置:网站首页>Hdu1847 problem solving ideas
Hdu1847 problem solving ideas
2022-07-28 16:39:00 【saddlesad】
HDU1847( Bash Game )
- Ideas : Because it is the last time to win ( Definition of bash game ), So for starters , Make sure you don't win immediately after you take it
- reflection , When n by 2^k when , Win first f;
- When n No 2 ^ k when , If you want to win first , It is necessary to ensure that the status after fetching is " Later stage " Winning state ,
- such as n6 when , You can take it first 1,2,4, And I know n2,4,5 When the state is " First of all " victory , Then the final backhand wins
- When again n7 when , If you take it first 4, And I know n3 When the state is " Later stage " victory , So finally win first
- Further generalize , Can be found when n from 1 Gradually increase , The winner in succession is “ First in order ” loop
- n==1,2,3( as well as 4,5,6) The situation is easy to prove , When n>3 when , Make k=3z-2(z>=3 And z It's a positive integer. ) And k<=n<=k+2, that k, k+1, k+2 Form a group
- here ,k+1 You can always subtract 2 Get the last value of the previous group ( The winning state of the backhand ), So it won first ;
- k By subtracting 4 Get the last value of the upper group ( The winning state of the backhand ), So it is also the first to win ;
- and k+2 Subtract one 2 The last value of any previous group must not be obtained after the power of ( Because these values are 3 Multiple ), So it must be a victory for the backhand
边栏推荐
- 2021-04-02
- Solve the width overflow of rich text pictures such as uniapp
- 队列的介绍与实现(详解)
- 1. Simple command line connection to database
- Configure HyperMesh secondary development environment on vs Code
- 视频号找到金钥匙,抖音模仿后来人
- 配置web服务器步骤详细记录(多有借鉴)
- c语言编程当中两个!!的作用
- Microsoft question 100 - do it every day - question 16
- QT QString详解
猜你喜欢

Some suggestions on optimizing HyperMesh script performance

排序5-计数排序

LwIP development | realize TCP server through socket

8051 series MCU firmware upgrade IAP

HyperMesh运行脚本文件的几种方法

500million users, four years earlier than wechat... This app, which has been in operation for 15 years, will be permanently discontinued

Practical development tutorial of software problem repair tracking system (Part 1)

Dynamic programming -- digital statistics DP

LeetCode-学会对无序链表进行插入排序(详解)

The video Number finds the golden key, and Tiktok imitates the latecomers
随机推荐
1. Simple command line connection to database
IT远程运维是什么意思?远程运维软件哪个好?
Roson的Qt之旅#102 ListModel
Automatically pack compressed backup download and delete bat script commands
“蔚来杯“2022牛客暑期多校训练营3 ACFHJ
Kubeedge releases white paper on cloud native edge computing threat model and security protection technology
ANSYS二次开发 - MFC界面调用ADPL文件
Detectron2 installation and testing
百度编辑器ueditor,编辑内容过多时,工具栏不可见,不方便编辑或上传问题
QT QString详解
IM即时通讯开发优化提升连接成功率、速度等
Ansa secondary development - build ansa/meta secondary development environment on pycharm
ANSA二次开发 - 界面开发工具介绍
Design direction of daily development plan
视频号找到金钥匙,抖音模仿后来人
关于标准IO缓冲区的问题
ANSA二次开发 - Visual Studio Code上搭建ANSA二次开发环境
信号屏蔽与处理
解决电脑恶意广告弹窗的思路
MySQL view event status statements and modification methods