随笔分类 -  知识

摘要:程序中的所有数在计算机内存中都是以二进制的形式储存的。位运算说穿了,就是直接对整数在内存中的二进制位进行操作。比如,and运算本来是一个逻辑运算符,但整数与整数之间也可以进行and运算。举个例子,6的二进制是110,11的二进制是1011,那么6 and 11的结果就是2,它是二进制对应位进行逻辑运 阅读全文
posted @ 2016-09-13 18:15 PrayG 阅读(226) 评论(0) 推荐(0)
摘要:题目链接: http://codeforces.com/problemset/problem/710/D 分析:给你两个方程 a1k + b1 and a2l + b2,求在一个闭区间【L,R】中有多少个X,X满足 x = a1k' + b1 = a2l' + b2。 由此可以发现这两个方程满足线性 阅读全文
posted @ 2016-09-03 18:24 PrayG 阅读(587) 评论(0) 推荐(0)
摘要:Find an n × n matrix with different numbers from 1 to n2, so the sum in each row, column and both main diagonals are odd. Find an n × n matrix with di 阅读全文
posted @ 2016-08-26 13:17 PrayG 阅读(320) 评论(0) 推荐(0)
摘要:转载自:http://blog.csdn.net/fengchaokobe/article/details/7437767 目录 第一节 n阶幻方问题 第二节 由n阶幻方引发的思考正文第一节 n阶幻方问题 所谓n阶幻方问题,俗称“横竖斜相加和相等”(我们当时就是这么叫的)。用术语说就是:在一个N行N 阅读全文
posted @ 2016-08-26 13:01 PrayG 阅读(1142) 评论(0) 推荐(0)
摘要:原文地址:http://www.hankcs.com/program/cpp/cin-tie-with-sync_with_stdio-acceleration-input-and-output.html http://www.clanfei.com/2012/03/235.html 在网上查看别人 阅读全文
posted @ 2016-08-08 16:19 PrayG 阅读(30103) 评论(7) 推荐(20)
摘要:C. They Are Everywhere time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output C. They Are Every 阅读全文
posted @ 2016-08-08 16:17 PrayG 阅读(366) 评论(0) 推荐(0)
摘要:转载自:http://blog.csdn.net/LYHVOYAGE/article/details/22989659 set集合容器实现了红黑树(Red-Black Tree)的平衡二叉检索树的的数据结构, 在插入元素时,它会自动调整二叉树的排列,把该元素放到适当的位置,以确保每个子树根节点的键值 阅读全文
posted @ 2016-07-29 20:15 PrayG 阅读(178) 评论(0) 推荐(0)