codeforces-div2-449-B】的更多相关文章

Codeforces Round #449 (Div. 2) https://codeforces.com/contest/897 A #include<bits/stdc++.h> using namespace std; #define lson l,mid,rt<<1 #define rson mid+1,r,rt<<1|1 #define sqr(x) ((x)*(x)) #define pb push_back #define eb emplace_back…
http://codeforces.com/contest/716/problem/D 题目大意:给你一些边,有权值,权值为0的表示目前该边不存在,但是可以把0修改成另外一个权值.现在,我们重新建路,问让s-t的最短路能否刚好是L? 思路:暴力修改即可... //看看会不会爆int!数组会不会少了一维! //取物问题一定要小心先手胜利的条件 #include <bits/stdc++.h> using namespace std; #define LL long long #define AL…
http://codeforces.com/problemset/problem/677/D 题目大意: 给你一个n*m的图,上面有p种钥匙(p<=n*m),每种钥匙至少有一个,期初所有为1的钥匙都是可拿的,拿到了该钥匙以后(假设该钥匙的val是v)就可以拿v+1种类的钥匙.问最后拿到第p个钥匙最少走多少步?(钥匙为p种类的只有一种) 思路:官方题解貌似是二维线段树的,不过这题可以用另外一个方法来优化. 首先假设我们目前在的颜色的c,我们要到c+1颜色的格子里面去,如果单纯的对于每种颜色c跑一次…
C. New Year and Rating time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Every Codeforces user has rating, described with one integer, possibly negative or zero. Users are divided into two d…
http://codeforces.com/problemset/problem/896/C 题意: 对于一个随机序列,执行以下操作: 区间赋值 区间加 区间求第k小 区间求k次幂的和 对于随机序列,可以使用Old Driver Tree 就是将序列中,连续的相同值域合并为一段 然后暴力操作 #include<set> #include<vector> #include<cstdio> #include<iostream> #include<algor…
http://codeforces.com/contest/896/problem/B 题意: 交互题 n张卡片填m个1到c之间的数,1<=n*ceil(c/2)<=m 最后填出一个单调非降序列,输出每次填的位置 <=c/2: 从左开始扫描,遇到空位 或 比原数更优(<原数)就放 >c/2: 从右开始扫描,遇到空位 或 比原数更优(>原数)就放 以<=c/2为例: 空位就放,<原数就覆盖,>=原数就往后扫 这样每个位置最多只会被覆盖c/2次,(c/2…
http://codeforces.com/contest/896/problem/A 第i个字符串嵌套第i-1个字符串 求第n个字符串的第k个字母 dfs #include<map> #include<cstdio> #include<iostream> using namespace std; typedef long long LL; ]={" What are you doing at the end of the world? Are you bus…
又掉分了0 0. A. Scarborough Fair time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Are you going to Scarborough Fair? Parsley, sage, rosemary and thyme. Remember me to one who lives there. He on…
B. Chtholly's request time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output — Thanks a lot for today. — I experienced so many great things. — You gave me memories like dreams... But I have to le…
PROBLEM C/A. Nephren gives a riddle 题 http://codeforces.com/contest/896/problem/A codeforces 896a 897c 解 预第i个串的长度,由于k最大1e18,所以超过1e18的长度直接标记为无限大,不用计算 然后递归搜索即可 #include <iostream> #include <cstring> #include <cstdio> #include <cmath>…