感言:以后中国高中生的专场还是慎入!!!!
A题目还是比较简单
AC代码:
#include
#include
using namespace std;
struct p
{
int number;
int val;
}num[105];
bool cmp(p x,p y)
{
if(x.val==y.val)
return x.number>...
分类:
其他好文 时间:
2014-07-22 22:49:34
阅读次数:
186
题意:n个城市,中间有m条道路(双向),再给出k条铁路,铁路直接从点1到点v,现在要拆掉一些铁路,在保证不影响每个点的最短距离(距离1)不变的情况下,问最多能删除多少条铁路分析:先求一次最短路,铁路的权值大于该点最短距离的显然可以删去,否则将该条边加入图中,再求最短路,记录每个点的前一个点,然后又枚...
分类:
其他好文 时间:
2014-07-22 22:49:34
阅读次数:
282
解题报告
没什么好说的,大于m的往后面放,,,re了一次,,,
#include
#include
#include
#include
using namespace std;
struct node
{
int x,cd;
}num[1000000];
int main()
{
int n,m,c;
cin>>n>>m;
int i;
for...
分类:
其他好文 时间:
2014-07-22 22:49:16
阅读次数:
247
解题报告
算是规律题吧,,,x y z -x -y -z
注意的是如果数是小于0,要先对负数求模再加模再求模
给我的戳代码跪了,,,
#include
#include
#include
using namespace std;
long long x,y,z;
long long n;
int main()
{
cin>>x>>y;
cin>>n;
z=y...
分类:
其他好文 时间:
2014-07-22 22:49:15
阅读次数:
225
向下取整 floor (地板) import?math
math.floor(-2.2)
#?-3.0
math.floor(2.2)
#?2.0 向上取整 ceil (天花板) import?math?
math.ceil(-2.2)
#?-2.0
math.ceil(2.2)
#?3.0 舍入 round round(2.24,?1)
...
分类:
其他好文 时间:
2014-07-21 10:24:47
阅读次数:
209
A - Jzzhu and Children找到最大的ceil(ai/m)即可#include #include using namespace std;int main(){ int n,m; cin >> n >> m; double a, maxv = 0; int m...
分类:
其他好文 时间:
2014-07-21 09:39:57
阅读次数:
327
Jzzhu has invented a kind of sequences, they meet the following property:
You are given x and
y, please calculate fn modulo
1000000007 (109?+?7).
Input
The first line contains two integers...
分类:
其他好文 时间:
2014-07-20 10:43:17
阅读次数:
213
很简单的一个递推法的题目,我直接用矩阵快速幂去过了。
构造方法也很简单。
f1 + f3 = f2
f3 = f2 - f1
f3 = 1 * f2 + -1 * f1
f2 = 1 * f2 + 0 * f1
所以矩阵就是
1, -1
1, 0
然后就是取模运算和负数处理了。负数取模会返回负数。因为我是快速幂的写法,最后返回的数一定是在(-Mod, Mod)之间的,所以直接加上一个Mod,然后再取一次模就好了。...
分类:
其他好文 时间:
2014-07-20 10:28:28
阅读次数:
314
题解
就是一个网格状的物品,n行m列,笔直直的切k刀,问所有的可能性中,最大的,每次切出来的结果最小的块的大小。
自己瞎贪心跪了。赛后发现其实可以枚举可能的在行这个方向切得刀数r,计算列方向切的刀数o,然后更新答案的方法。当然,枚举的时候也是只枚举因数,这样就可以把复杂度从O(N)降到O( sqrt(N) )。中间在加上一些优化,然后就没事了。...
分类:
其他好文 时间:
2014-07-20 10:21:28
阅读次数:
200
Codeforces Round #257 (Div. 2) 题解...
分类:
其他好文 时间:
2014-07-20 10:18:28
阅读次数:
526