摘要:
luogu 传送门#include#include#include#include #include#include#include#includeusing namespace std;int n;int px[709],py[709];double f[701][701];int... 阅读全文
posted @ 2017-09-24 17:48
primes
阅读(132)
评论(0)
推荐(0)
摘要:
luogu 传送门标准的二分答案。 check中,我们用bfs判断以当前的标准是否能拓展出所有的路标。 注:此题是m行n列。#include#include#include#include #include#include#includeusing namespace std;int... 阅读全文
posted @ 2017-09-24 17:48
primes
阅读(197)
评论(0)
推荐(0)
摘要:
http://codevs.cn/problem/1959/ 有两种做法: 第一种:dp;不过这个dp比较难想,而且比较特别,,解释见代码注释。#include#include#include#include using namespace std;int n,sum,k,a[105... 阅读全文
posted @ 2017-09-24 17:48
primes
阅读(180)
评论(0)
推荐(0)
摘要:
https://www.luogu.org/problem/show?pid=1197思路和关闭农场差不多,不过加了一些时间上的优化。 当我们加入一个点时,先假设又加入一个单独的连通块,然后再扫一下与它相连的点如果在图中但是与它不在一个联通块中,那么就将其合并,连通块个数减一。 注:... 阅读全文
posted @ 2017-09-24 17:48
primes
阅读(74)
评论(0)
推荐(0)
摘要:
https://www.luogu.org/problem/show?pid=1936暴力发现,符合式子的两个数是菲波那切数列的相邻两项。 然后分析是这样的: 记f(n,m)=(n^2-mn-m^2)^2则有f(m+n,m)=[(m+n)^2-n(m+n)-n^2]^2=(n^2+m... 阅读全文
posted @ 2017-09-24 17:48
primes
阅读(76)
评论(0)
推荐(0)
摘要:
#include#include#include#include#includeusing namespace std;int n,k,ans;int main(){ cin>>n>>k; while(n>=k) { ans+=k; n=... 阅读全文
posted @ 2017-09-24 17:48
primes
阅读(232)
评论(0)
推荐(0)
摘要:
https://www.luogu.org/problem/show?pid=2614 这是一道模拟题,就是细节有点多。 首先,括号里没有 - ,所以是 - 时,直接当成音符处理,又因为没有超过4个节拍的音符,所以遇到‘.’,判断前面是不是 - ,与普通字符分开处理就可以了。#inc... 阅读全文
posted @ 2017-09-24 17:48
primes
阅读(148)
评论(0)
推荐(0)
摘要:
Codevs 传送门题目描述 Description 奶牛们在FJ的养育下茁壮成长。这天,FJ给了奶牛Bessie一个任务,去看看每个奶牛场中若干只奶牛的身高,由于Bessie是只奶牛,无法直接看出第i只奶牛的身高,而只能看出第i只奶牛与第j只奶牛的身高差,其中第i 只奶牛与第... 阅读全文
posted @ 2017-09-24 17:48
primes
阅读(102)
评论(0)
推荐(0)
摘要:
要知道90的倍数各位加起来肯定是9的倍数,而且最后一位一定是0。#include#include#include#includeusing namespace std;int n,num1,num2;int a[1009];int cmp(int x,int y){return x>... 阅读全文
posted @ 2017-09-24 17:48
primes
阅读(177)
评论(0)
推荐(0)
摘要:
https://www.luogu.org/problem/show?pid=2667#subn#include#include#include#includeusing namespace std;int n,ans[101],cnt;bool Isprime(int x){ ... 阅读全文
posted @ 2017-09-24 17:48
primes
阅读(227)
评论(0)
推荐(0)

浙公网安备 33010602011771号