传送门:点我 A. Lengthening Sticks time limit per test 1 second You are given three sticks with positive integer lengths of a,?b, and c centimeters. You can ...
分类:
其他好文 时间:
2019-03-09 11:37:18
阅读次数:
188
我枯辽 开始这一段 打成了 然后导致一直爆炸 1 #include<bits/stdc++.h> 2 using namespace std; 3 const int N=100+5; 4 bool v[N]; 5 int len,n,a[N],sum,m; 6 template<class t>v ...
分类:
其他好文 时间:
2019-03-08 12:46:58
阅读次数:
174
layout: post title: Codeforces Round 258(Div. 2) author: "luowentaoaa" catalog: true tags: mathjax: true codeforces 卢卡斯定理 传送门 "[A Game With Sticks" (签 ...
分类:
其他好文 时间:
2019-03-05 17:06:04
阅读次数:
206
小木棍 dfs 剪枝 把所有木棍从大到小排序 优化搜索顺序(较大的木棍更不容易凑出需要的长度,使之后的剪枝更早发生) 枚举可能的原始木棍长度,(注意这里不满足单调性,不能二分答案),这里可以把最长的一根现有木棍作为枚举的下界,上界为所有木棍更总长度。 答案只可能为总长度的因数,在枚举过程中其他的数可 ...
分类:
其他好文 时间:
2019-02-12 01:43:29
阅读次数:
157
A. Salem and Sticks 签. 1 #include <bits/stdc++.h> 2 using namespace std; 3 4 #define N 1010 5 int n, a[N]; 6 7 int work(int x) 8 { 9 int res = 0; 10 f ...
分类:
其他好文 时间:
2019-01-31 17:08:37
阅读次数:
196
题目链接:Salem and Sticks 题目原文 Salem gave you 𝑛n sticks with integer positive lengths 𝑎1,𝑎2,…,𝑎𝑛a1,a2,…,an. For every stick, you can change its lengt ...
分类:
其他好文 时间:
2019-01-27 21:33:58
阅读次数:
264
题目大意:有一堆小木棍,把它们接成相同长度的小木棍,问结果的小木棍的最小长度是多少,多组数据题解:$dfs$,各种剪枝。卡点:无C++ Code: ...
分类:
其他好文 时间:
2019-01-27 16:28:14
阅读次数:
168
A. Salem and Sticks 由于长度很小,所以直接暴力枚举最后的长度即可,取最小值即可。 #include<bits/stdc++.h> #define CLR(a,b) memset(a,b,sizeof(a)); using namespace std; typedef long l ...
分类:
其他好文 时间:
2019-01-27 14:42:58
阅读次数:
230
A. Salem and Sticks time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output A. Salem and Sticks t ...
分类:
编程语言 时间:
2019-01-22 10:48:23
阅读次数:
150