Codeforces Round #409】的更多相关文章

A. Vicious Keyboard time limit per test:2 seconds memory limit per test:256 megabytes input:standard input output:standard output Tonio has a keyboard with only two letters, "V" and "K". One day, he has typed out a string s with only t…
地址:http://codeforces.com/contest/801/problem/D 题目: D. Volatile Kite time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output You are given a convex polygon P with n distinct vertices p1, p2, ..., p…
地址:http://codeforces.com/contest/801/problem/C 题目: C. Voltage Keepsake time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output You have n devices that you want to use simultaneously. The i-th devi…
题目链接:http://codeforces.com/contest/801/problem/C 题意:给出一个充电器每秒钟充p个点,还有n个电器要同时使用a[i]表示第i个电器每秒钟用多少点,b[i]表示第i个 原来存了都少电.充电器可以无缝切换这充电,但是只能给一个充(同一时间).最后问你最长可用多久,如果可以 无限时间的用的话,就输出-1. 题解:首先确定一下什么时候输出-1也就是可以无限充电的情况,就是p大于所有a的总和就行. 然后就是时间有限的情况.这里明确一个式子. need*t=a…
来自FallDream的博客,未经允许,请勿转载,谢谢. 和ditoly组队打VK-Cup,起了个名字叫Vegetable Chicken(意思显然),然后昨天我做AB他切C 很不幸的是.....我写的两题都挂了......坑队友了...A被疯狂卡精度  B简单计算几何瞎写挂了  GG 滚去外卡赛 A.Voltage Keepsake 你有n个东西,每个东西每秒钟消耗ai的能源,初始有bi的能源.你还有一个充电器,每秒钟可以充p的能源,问最多多久之后才有东西爆零.n<=100000 直接二分呗.…
A. Vicious Keyboard 题意:给你一个字符串,里面只会包含VK,这两种字符,然后你可以改变一个字符,你要求VK这个字串出现的次数最多. 题解:数据范围很小,暴力枚举改变哪个字符,然后check就好. #include<bits/stdc++.h> using namespace std; int main(){ string s; cin>>s; int ans = 0; for(int i=0;i<s.size();i++){ if(s[i]=='V'){…
A 每次可以换一个或不换,暴力枚举位置即可 B 模拟 C 二分答案.. 边界可以优化r=totb/(tota-p),二分可以直接(r-l>=EPS,EPS不要太小,合适就好),也可以直接限定二分的次数(防止死循环! 一开始EPS=1e-10,结果TLE) 注意精度问题 long double,在统计和的时候注意long long…
A. Vicious Keyboard time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Tonio has a keyboard with only two letters, "V" and "K". One day, he has typed out a string s with only t…
第一题很水但是wa了一发,因为没考虑K前面是K的情况 #include<map> #include<set> #include<cmath> #include<queue> #include<stack> #include<vector> #include<cstdio> #include<cassert> #include<iomanip> #include<cstdlib> #inc…
传送门 题意 A.询问最多改变一个字符的字符串"VK"子串数量 B.f(x,z)=y,给出x,y,求z For example, f("ab", "ba") = "aa", and f("nzwzl", "zizez") = "niwel". C.一个充电器充电\(p/min\),n台机器消耗电\(a_i/min\),一开始每台机器拥有电\(b_i\),问最多能使所有…