转圈游戏 题解:快速幂 1 #include 2 3 int n, m, k, x; 4 5 inline long long QuickPow(int a, int k, int MOD){ 6 long long base = a, ret = 1; 7 while (k...
分类:
其他好文 时间:
2014-07-22 22:44:34
阅读次数:
284
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4814
题目大意:
把一个正整数表示为φ进制, φ = (1+√5)/2 。
且已知:
1. φ + 1 = φ 2 ,所以有11(φ)
= 100(φ),且要求11要转变为100
2. 2 *
φ 2 = φ3 +
1 。
解题思路:
观察发现,2 = 10.0...
分类:
其他好文 时间:
2014-07-22 22:39:34
阅读次数:
216
1.**复制RHEL光盘内容到本地磁盘** 将RHEL光盘的内容复制到一个本地目录下: /var/yum/rhel-6.5/ 2.**创建本地源配置文件** # touch /etc/yum.repos.d/local.repo # vim /etc/yum.repos.d/local.repo [base] nam...
分类:
其他好文 时间:
2014-07-22 09:00:05
阅读次数:
190
Rails
Time Limit:1000MS Memory Limit:10000KB 64bit IO Format:%I64d
& %I64u
Submit Status
Description
There is a famous railway station in PopPush City. Country there is incre...
分类:
其他好文 时间:
2014-07-22 00:29:36
阅读次数:
210
枚举+最短路问题。
题意依然晦涩难懂。
新建一个消防站n 可以使得所有交叉路口到最近的一个消防站的距离中最大值减小,且n 是满足条件的交叉路口序号中序号最小的。
先每个消防站做SPFA。找到所有点 到最近消防站的 距离。
然后枚举 每个不是消防站的点,找到距离这个点的最大距离。然后比对 最大是否更新了。
ORZ的是,输入边的时候要EOF。简直……
谁是出...
分类:
其他好文 时间:
2014-07-21 13:21:36
阅读次数:
205
1.配置SpringMVC-Servlet.xml <!--?注解扫描包,在这个包下的类都会启用注解?-->
<context:component-scan?base-package="com.tgb.web.controller.annotation"?/>
<!--?开启注解?2种皆可-->
<mvc:annotati...
分类:
编程语言 时间:
2014-07-21 10:16:16
阅读次数:
272
前言(废话):鼓捣 Stylish 的时候发现了这么个奇怪的代码行:Data:image/gif;BASE64,R0lGODlhEAAQAKEAAEKF9NPi/AAAAAAAACH5BAEAAAIALAAAAAAQABAAAAIkFI6Zpu0YYnxnAvtC0hTzzH3UJY6kSUqdiC...
分类:
其他好文 时间:
2014-07-21 09:32:57
阅读次数:
421
C++ 复制函数
说道C++复制函数,大家也许并不陌生,就是类中的拷贝构造函数和赋值操作符,但是事实上也许我们一不小心就会忽略编译器所做的一些默认操作。引起晦涩的错误。下面分析几种场景:
一、场景一:全部默认
#include
class base{
public:
base(){}
base(int dt):data(dt){}
void get(){pri...
分类:
编程语言 时间:
2014-07-20 22:45:53
阅读次数:
341
在Cocos2d-x存储数据使用的类是UserDefault类,下面分析下该类的使用
//.h
#include "base/CCPlatformMacros.h"
#include
#include "base/CCData.h"
NS_CC_BEGIN
/**
* @addtogroup data_storage
* @{
*/
/**
* UserDefault act...
分类:
其他好文 时间:
2014-07-20 15:45:51
阅读次数:
221
There are N gas stations along a circular route, where the amount of gas at station i is gas[i].
You have a car with an unlimited gas tank and it costs cost[i] of
gas to travel from station i to ...
分类:
其他好文 时间:
2014-07-19 23:24:39
阅读次数:
223