A. Cow and Haybales 题意: 有n堆草,每堆为ai,每分钟一次可以移动1个草从x到x 1或x+1。求在d分钟内,可以将第一堆的a1最大增加到多少。 思路: 从右2,3..依次枚举,要考虑距离以及是移动的最后一堆能移多少 代码: cpp include using namespace ...
分类:
其他好文 时间:
2020-03-18 15:18:40
阅读次数:
65
结论:后手必胜当且仅当根节点为直径中点。 根节点为直径中点: 如果两人都在直径上移动,那么不论先手如何移动,后手总能移动到对称的位置。 如果先手移出了直径,设这一点与根节点的距离为$x$,那么后手仍然回到直径上距离根节点$x$的点。 其它的情况先手只需移动至直径中点(当直径中点在边上时移动至该边的一 ...
分类:
其他好文 时间:
2020-03-15 16:27:10
阅读次数:
65
You want to perform the combo on your opponent in one popular fighting game. The combo is the string ss consisting of nn lowercase Latin letters. To p ...
分类:
其他好文 时间:
2020-03-13 19:02:07
阅读次数:
72
题意: 0到N的数轴上,每次可以选择移动到x-1,x+1,2*x,问从n移动到k的最少步数。 思路: 同时遍历三种可能并记忆化入队即可。 Tips: n大于等于k时最短步数为n-k。 在移动的过程中可能会越界、重复访问。 poj不支持<bits/stdc++.h>和基于范围的for循环。 #incl ...
分类:
其他好文 时间:
2020-03-13 18:38:08
阅读次数:
50
内部类初识 用内部类的原因有以下几种: 1. 内部类提供了更好的封装,如果内部类声明成private访问权限的话,那就只有外部类能够调用它了,同一个包的其他类都不能访问。 2. 比如说Cow类和CowLeg类,CowLeg类如果离开了Cow将毫无意义,就可以把CowLeg类定义成Cow类的内部类 3 ...
分类:
其他好文 时间:
2020-03-10 21:35:36
阅读次数:
53
下面是我找的资源 https://wow.techbrood.com/uploads/160601/obj/banana.obj https://threejs.org/examples/models/obj/male02/male02.obj http://game.gtimg.cn/images ...
分类:
其他好文 时间:
2020-03-09 22:40:25
阅读次数:
84
从概念及作用、主要的功能模块、基本的架构组成、以及其支持虚拟机镜像的格式类型四个方面详细介绍OpenStack中Glance项目。
分类:
其他好文 时间:
2020-03-09 22:28:30
阅读次数:
141
public class button : MonoBehaviour { public GameObject obj;//声明Text游戏对象 private int counter = 1;//声明计数器连良 void Update() { if (counter % 2 == 0)//当计数器 ...
分类:
其他好文 时间:
2020-03-09 20:55:19
阅读次数:
51
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Treasure Hunter In this game, you will play as a treasure hunter to find a mysterious treasure. In ...
分类:
编程语言 时间:
2020-03-08 20:18:44
阅读次数:
84
``` #include #include #include #include using namespace std; #define N 10100 int vis[N], h[N], used[N], maps[1510][1510], n, ans; int e[N],ne[N],idx; ... ...
分类:
其他好文 时间:
2020-03-06 22:15:15
阅读次数:
53