输出整数N,使得  t1 <= N  统计有多少组t1,t2,t3,满足:1<t1<t2<t3<=1000000,t3-t1<=25,且t1,t2,t3的最小公倍数是N 枚举t1就好了 #include <iostream> #include <cstdio> #include <sstream> #include <cstring> #include <map> #include <set> #i…
Description Perhaps you all have heard the mythical story about Tower of Hanoi (The details of this story is not required to solve this problem): “There is a tower of Hanoi with 64 disks and three pegs and the preists make one move everyday and the e…
Perhaps you all have heard the mythical story about Tower of Hanoi (The details of this story is not required to solve this problem): “There is a tower of Hanoi with 64 disks and three pegs and the preists make one move everyday and the earth will be…
/* 现将相同的合并计数. 再枚举判断是否符合当cou==n*n是符合就退出 */ #include<stdio.h> #include<string.h> #define N 900 int en[N][4],num[N],real[N][4],len,n,ok; void pp(int a[4],int b[4])//赋值 { a[0]=b[0]; a[1]=b[1]; a[2]=b[2]; a[3]=b[3]; } void print(int a[4]) { printf(…
由于解集只为{0, 1, 2}故消元后需dfs枚举求解 #include<cstdio> #include<iostream> #include<cstdlib> #include<cstring> #include<string> #include<algorithm> #include<map> #include<queue> #include<vector> #include<cmath…
Divisors Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 9617   Accepted: 2821 Description Your task in this problem is to determine the number of divisors of Cnk. Just for fun -- or do you need any special reason for such a useful compu…
传送门:http://codeforces.com/contest/1081/problem/E E. Missing Numbers time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Chouti is working on a strange math problem. There was a sequence of nn …
1.LA 5694 Adding New Machine 关键词:数据结构,线段树,扫描线(FIFO) #include <algorithm> #include <cstdio> #include <cstring> #include <string> #include <queue> #include <map> #include <set> #include <ctime> #include <cm…
"在一个全集\(X\)中若干子集的集合为\(S\),精确覆盖(\(\boldsymbol{Exact~Cover}\))是指,\(S\)的子集\(S*\),满足\(X\)中的每一个元素在\(S*\)中恰好出现一次.在计算机科学中,精确覆盖问题指找出这样的一种覆盖,或证明其不存在." \(0x01\) 精准覆盖问题 --其实是一种决策问题,给定\(n\)行长度为\(m\)的\(0,1\)序列,要求选出一些行,使得每一列有且仅有一个\(1\),这就是精准覆盖问题. 诚然,我搜索贼菜,所以暂…
http://acm.hust.edu.cn/vjudge/contest/view.action?cid=28417#problem/F 题目大意:给n个点,求相聚最远距离的平方(输出整形) 集体思路:先求出包围所有点的凸包,然后暴力枚举求解(直接暴力会超时) #include<iostream> #include<cmath> #include<string.h> #include<string> #include<stdio.h> #inc…