链接:http://poj.org/problem?id=1808
http://acm.timus.ru/problem.aspx?space=1&num=1132
题意:两道题都是模板题,第一个是判断是否有平方剩余,第二个是计算平方剩余。
思路:平方剩余就是给定a,n(n为质数) 问 x^2 ≡ a (mod n) 是否有解,可以用a^((n - 1)/2) ≡ ±1(mod n) ...
分类:
其他好文 时间:
2014-08-02 10:03:33
阅读次数:
306
Description
Vasya is a ufologist and his duties include observing Unidentified Flying Objects (UFOs) in the part of space bounded by a cube N × N ×N. The cube is divided into cubic sectors 1 ...
分类:
其他好文 时间:
2014-08-01 19:58:52
阅读次数:
302
平台:Ubuntu12.10在Ubuntu的中文系统中自带了中文输入法,通过Ctrl+Space可切换中英文输入法。这里我们主要说下Ubuntu英文系统中,中文输入法的安装。第一步,安装语言包。我们选择System Settings-->Language Support-->Install/Remo...
分类:
其他好文 时间:
2014-08-01 18:56:42
阅读次数:
263
Determine whether an integer is a palindrome. Do this without extra space.click to show spoilers.Some hints:Could negative integers be palindromes? (i...
分类:
其他好文 时间:
2014-08-01 12:49:41
阅读次数:
186
链接:http://poj.org/problem?id=1696Space AntTime Limit:1000MSMemory Limit:10000KTotal Submissions:3077Accepted:1965DescriptionThe most exciting space di...
分类:
其他好文 时间:
2014-08-01 10:39:13
阅读次数:
247
Problem Description:
Given a sorted array, remove the duplicates in place such that each element appear only once and return the new length.
Do not allocate extra space for another array, you ...
分类:
其他好文 时间:
2014-08-01 00:08:50
阅读次数:
274
1.ASCII 返回与指定的字符对应的十进制数;SQL>select ascii('A') A,ascii('a') a,ascii('0') zero,ascii(' ') space from dual;2.chr 给出整数,返回对应的字符;SQL>select chr(55203) zhu,c...
分类:
数据库 时间:
2014-07-31 20:11:57
阅读次数:
306
java.lang.OutOfMemoryError: PermGen space这个错误是指内存的永久保存区域,它主要存放的是Class和Meta信息,在Class被loader(加载时)就会放到PermGen space中,这块区域不会被GC定时清理,这个错误经常发生在web服务器在对JSP进行...
分类:
编程语言 时间:
2014-07-31 19:59:07
阅读次数:
252
题目链接:Building a Space Station
最小生成树的模板题,prim和kuruskal都可以,但是要注意精度损失。
题意:给定一个三维坐标系,给定一些圆的圆心坐标,和半径,求出所有圆心构成的最小生成树;
特别注意:两个圆如果相交在一起,算做联通,距离为0;
C++提交
#include
#include
#include
#include
#include
...
分类:
其他好文 时间:
2014-07-31 17:06:56
阅读次数:
215
Building a Space Station
Time Limit: 1000MS Memory Limit: 30000K
Total Submissions: 4400 Accepted: 2255
Description
You are a member of the space station engineering team, and are assigned a tas...
分类:
其他好文 时间:
2014-07-31 13:18:36
阅读次数:
280