类可以允许其他类或者函数访问它的私有成员,方法是令其他类或者函数成为它的友元。如果类想把一个函数或者类声明成它的友元,只需要增加一条以friend关键字开始的声明语句即可。 友元声明只能出现在类定义的内部,但是在类内出现的具体位置不限。友元不是类的成员也不受它所在区域访问控制级别的约束,一般来说,最 ...
分类:
编程语言 时间:
2017-02-26 10:58:39
阅读次数:
218
A. 我的做法是nmlogn的。。。。直接做m次堆贪心就可以。按理说是能过的。。。 正解直接是在原dp上搞一搞。。。可以做到n^2+nlog? 2333 B. 第一问的话,可以用phi(a*b)=phi(a)*phi(b)*gcd(a,b)/phi(gcd(a,b)),那么可以筛出所有需要的东西。 ...
分类:
其他好文 时间:
2017-02-18 16:51:59
阅读次数:
217
http://codeforces.com/problemset/problem/730/A 题意:有n个人打天梯,想让这n个人的分数相同,每场比赛必须有2-5个人参赛,参赛的人会降低一分,问一个合理方案让所有人的分数相同。 思路:不限制比赛场数,那么只用考虑2-3个人参赛的情况(因为4和5可以由2 ...
分类:
其他好文 时间:
2017-02-15 12:27:35
阅读次数:
186
有些人说“这是一种通过javascript语言开发web服务端的东西”。更直白的可以理解为:node.js有非阻se塞,事件驱动/O等特性,从而让高并发(high concurrency)在的轮询和comet构建的应用中成为可能。 浏览器给网站发请求的过程一直没怎么变过。当浏览器给网站发了请求,服务 ...
分类:
Web程序 时间:
2017-02-12 18:51:54
阅读次数:
246
1、数据库用的mysql,一共有3张表,一张用户表user、一张朋友列表friend和一张消息表message。 2、服务器端架构 3、model包解析 4、db包解析 主要作用是加载类,获取mysql数据库的连接 5、util包解析 第一个类Packager 第二个类Parser 6、contro ...
分类:
移动开发 时间:
2017-02-11 15:55:27
阅读次数:
198
Mahmoud wrote a message s of length n. He wants to send it as a birthday present to his friend Moaz who likes strings. He wrote it on a magical paper ...
分类:
其他好文 时间:
2017-02-10 01:43:56
阅读次数:
264
Pendant Problem Description On Saint Valentine's Day, Alex imagined to present a special pendant to his girl friend made by K kind of pearls. The pend ...
分类:
其他好文 时间:
2017-02-09 23:33:16
阅读次数:
367
Big Truck Photo by Phil Whitehouse Your boss has hired you to drive a big truck, transporting items between two locations in a city. You’re given a de... ...
分类:
其他好文 时间:
2017-02-08 10:30:52
阅读次数:
395
Index of contents Setting up the MinGW 64 environment Step 1) building libiconv Step 2) building libz Step 3) building libjpeg Step 4) building libpng ...
分类:
Web程序 时间:
2017-02-07 01:29:51
阅读次数:
1263