HDU 3501 Calculation 2
大意:求1~n之间与n不互质的数的总和。
思路:欧拉函数的应用;先用欧拉函数求出与n互质的总数m,计算m个数的总和,用n的总和减去m的总和就是想要的结果。
#include
#define LL __int64
int eular(int n){
int ret = 1;
for(int i = 2; ...
分类:
其他好文 时间:
2014-05-10 09:54:28
阅读次数:
297
链接:http://poj.org/problem?id=1789 或 http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=1158
Description
Advanced Cargo Movement, Ltd. uses trucks of different types. Some trucks are use...
分类:
其他好文 时间:
2014-05-10 09:39:59
阅读次数:
440
NFC Basics
The Tag Dispatch System:
How NFC tags are mapped to MIME types and URIs(NFC标签是如何映射到MINE类型和URI的?):
How NFC Tags are Dispatched to Applications:
Requesting NFC Access in the Android Manifest:
Filtering for NFC Intents
Creating Common Types of NDEF...
分类:
移动开发 时间:
2014-05-10 09:39:25
阅读次数:
689
链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=586
In the planet w-503 of galaxy cgb, there is a kind of intelligent creature named QS. QScommunicate with each other via networks. If...
分类:
Web程序 时间:
2014-05-10 09:38:02
阅读次数:
537
链接:http://poj.org/problem?id=2421 或 http://acm.hdu.edu.cn/showproblem.php?pid=1102
Problem Description
There are N villages, which are numbered from 1 to N, and you should build some roads ...
分类:
其他好文 时间:
2014-05-10 09:34:09
阅读次数:
389
HDU 1286 找新朋友
题意:中文题。
思路:欧拉函数的纯模板题,没什么好说的,主要是理解欧拉函数的意义。
在数论,对正整数n,欧拉函数是少于或等于n的数中与n互质的数的数目。此函数以其首名研究者欧拉命名,它又称为Euler's
totient function、φ函数、欧拉商数等。 例如φ(8)=4,因为1,3,5,7均和8互质。
----by度娘。...
分类:
其他好文 时间:
2014-05-10 09:14:43
阅读次数:
256
链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=203
Description:
We all remember that in the movie Swordfish, Gabriel broke into the World Bank Investors Group in West Los Angeles, to...
分类:
其他好文 时间:
2014-05-10 09:11:52
阅读次数:
343
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4720
用几何模板,求外接圆,再判断点在不在圆内
#include
#include
#include
const double esp = 1e-9;
//点
struct Point {
double x, y;
Point() {}
Point(double x...
分类:
其他好文 时间:
2014-05-10 08:52:52
阅读次数:
336
http://acm.hdu.edu.cn/showproblem.php?pid=3033
大致题意:某人要买鞋子,有k种鞋,要求每种鞋至少买一双,给出每双鞋子的花费和价值,问m元钱可以买到的鞋子的最大价值是多少。
思路:分组背包问题。与传统的分组背包不同:每组物品至少取一件;且每组中物品任意取。
想一想传统的分组背包,每组至多选一件:
for 所有的组k
fo...
分类:
其他好文 时间:
2014-05-10 08:48:59
阅读次数:
325
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4726
思路:贪心,尽量先组大的数字,注意考虑前导零的情况
代码:
#include
#include
const int N = 1000005;
int t, v1[10], v2[10], ans[N];
char s1[N], s2[N];
void solve() {
i...
分类:
其他好文 时间:
2014-05-10 02:19:03
阅读次数:
259