Codeforces 749C. Voting 模拟题】的更多相关文章

C. Voting time limit per test: 1 second memory limit per test: 256 megabytes input: standard input output: standard output There are n employees in Alternative Cake Manufacturing (ACM). They are now voting on some very important question and the lead…
大意: n个人, 两个党派, 轮流投票, 两种操作(1)ban掉一个人 (2)投票, 每轮一个未被ban的人可以进行一次操作(1)或操作(2), 求最终哪个党派得票最多. 显然先ban人会更优, 所以维护两个set模拟. 不过好像可以有O(n)的做法? #include <iostream> #include <sstream> #include <algorithm> #include <cstdio> #include <math.h> #i…
C. Voting time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output There are n employees in Alternative Cake Manufacturing (ACM). They are now voting on some very important question and the leading…
CodeForces - 344A id=46664" style="color:blue; text-decoration:none">Magnets Time Limit: 1000MS   Memory Limit: 262144KB   64bit IO Format: %I64d & %I64u Submit Status Description Mad scientist Mike entertains himself by arranging ro…
FST的时候好像挂了挺多人的~ 其实思路没啥难的,就是更好地理解题意吧,1到n一直循环,直到没有人能vote,一个人能vote也能叉掉一个人,一个人被叉就不能vote,判谁赢. 其实我管vote干嘛,我管好互叉就好了啊,直到局势一边倒,也就是不能叉了,谁多谁赢,这样肯定是要么D多R多,复杂度不大. #include<bits/stdc++.h> using namespace std; typedef __int64 LL; const int N=2e5+10; bool vis[N]; c…
有点意思的题 Voting CodeForces - 749C 题意:有n个人投票,每次按照第1个人~第n个人的顺序发言,如果到某个人发言时他已经被禁止发言就跳过,每个人发言时可以禁止另一个人发言或什么也不做.最后只剩下一个人时,那个人的意见就是最终决定的意见.这些人分为D和R两派,也就是每个人有D和R两种意见中的一种,每一派的人都希望自己派的意见成为最终意见.假设每个人都作出最优选择,请根据每个人的派别判断最终决定的意见. 方法:第i个人发言的时候,就按照第i~第n,第1~第i-1的顺序找出第…
Ballot Analyzing Device 题目连接: http://codeforces.com/gym/100269/attachments Description Election committee of Flatland is preparing for presidential elections. To minimize human factor in ballot counting they decided to develop an automated Ballot Ana…
Prison Transfer Time Limit: 1000MS   Memory Limit: 262144KB   64bit IO Format: %I64d & %I64u Submit Status Description The prison of your city has n prisoners. As the prison can't accommodate all of them, the city mayor has decided to transfer c of t…
A. Extract Numbers Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/600/problem/A Description You are given string s. Let's call word any largest sequence of consecutive symbols without symbols ',' (comma) and ';' (semicolon…
B. The Queue time limit per test:1 second memory limit per test:256 megabytes input:standard input output:standard output Finally! Vasya have come of age and that means he can finally get a passport! To do it, he needs to visit the passport office, b…