Codeforces Round #367 (Div. 2)】的更多相关文章

Vasiliy's Multiset 题目链接: http://codeforces.com/contest/706/problem/D Description Author has gone out of the stories about Vasiliy, so here is just a formal task description. You are given q queries and a multiset A, initially containing only integer…
Hard problem 题目链接: http://codeforces.com/contest/706/problem/C Description Vasiliy is fond of solving different tasks. Today he found one he wasn't able to solve himself, so he asks you to help. Vasiliy is given n strings consisting of lowercase Engl…
Interesting drink 题目链接: http://codeforces.com/contest/706/problem/B Description Vasiliy likes to rest after a hard work, so you may often meet him in some bar nearby. As all programmers do, he loves the famous drink "Beecola", which can be bough…
Beru-taxi 题目链接: http://codeforces.com/contest/706/problem/A Description Vasiliy lives at point (a, b) of the coordinate plane. He is hurrying up to work so he wants to get out of his house as soon as possible. New app suggested n available Beru-taxi…
题目链接:Codeforces Round #367 (Div. 2) D. Vasiliy's Multiset 题意: 给你一些操作,往一个集合插入和删除一些数,然后?x让你找出与x异或后的最大值 题解: trie树xjb搞就行,每次要贪心,尽量满足高位为1. #include<bits/stdc++.h> #define F(i,a,b) for(int i=a;i<=b;i++) using namespace std; namespace trie { )*; ],ed=-,c…
题目链接:Codeforces Round #367 (Div. 2) C. Hard problem 题意: 给你一些字符串,字符串可以倒置,如果要倒置,就会消耗vi的能量,问你花最少的能量将这些字符串排成字典序 题解: 当时1点过头太晕了,看错题了,然后感觉全世界都会,就我不会,- -!结果就是一个简单的DP, 设dp[i][0]表示第i个字符串不反转的情况,dp[i][1]表示第i个字符串反转的情况 状态转移方程看代码 #include<bits/stdc++.h> #define F(…
Codeforces Round 367 Div. 2 点击打开链接 A. Beru-taxi (1s, 256MB) 题目大意:在平面上 \(n\) 个点 \((x_i,y_i)\) 上有出租车,每辆出租车的行驶速度为 \(v_i\),求所有出租车到点 \((a,b)\) 的时间中的最短时间. 数据范围:\(-100 \leq a,b,x_i,y_i \leq 100\),\(v_i \leq 100\),\(n \leq 1000\) 简要题解:依次求出所有的时间,取最小值即可. 时空复杂度…
http://codeforces.com/contest/706/problem/D 题意:有多种操作,操作1为在字典中加入x这个数,操作2为从字典中删除x这个数,操作3为从字典中找出一个数使得与给定的数的异或值最大. 思路: 因为这道题目涉及到删除操作,所以用一个变量cnt来记录前缀的数量,加入时就+1,删除时就减1.查询时前缀数量>0时就说明是存在的. #include<iostream> #include<cstdio> #include<cstring>…
题目链接: http://codeforces.com/contest/706/problem/D D. Vasiliy's Multiset time limit per test:4 secondsmemory limit per test:256 megabytes 问题描述 Author has gone out of the stories about Vasiliy, so here is just a formal task description. You are given q…
A题 Beru-taxi 随便搞搞.. #include <cstdio> #include <cmath> using namespace std; int a,b,n; struct _ { int x,y,v; }p[]; double dis2(_ A) { return (a - A.x) * (a - A.x) + (b - A.y) * (b - A.y); } int main() { scanf("%d%d%d", &a, &b…