codeforces 388C Fox and Card Game】的更多相关文章

Codeforces Round #228 (Div. 1) 题目链接:C. Fox and Card Game Fox Ciel is playing a card game with her friend Fox Jiro. There are n piles of cards on the table. And there is a positive integer on each card. The players take turns and Ciel takes the first…
刚刚看到这个题感觉是博弈题: 不过有感觉不像,应该是个贪心: 于是就想贪心策略: 举了一个例子: 3 3 1 2 3 4 3 4 1 2 5 4 1 2 5 8 如果他们两个每次都拿对自己最有利的那个的话,C的得分是14分: 但是C作为第一个选手,他有更好的策略,只拿前一半,后一半给J,中间的再分:这样的话C的得分就能达到15分: 同样J也有这样的策略,他也能保证自己最少能拿到后一半的分(跟风式的拿): 这样的话,贪心策略就明朗了! #include<cstdio> #include<c…
C. Fox and Card Game 题目连接: http://codeforces.com/contest/388/problem/C Description Fox Ciel is playing a card game with her friend Fox Jiro. There are n piles of cards on the table. And there is a positive integer on each card. The players take turns…
题目链接:http://codeforces.com/problemset/problem/462/B Appleman has n cards. Each card has an uppercase letter written on it. Toastman must choose k cards from Appleman's cards. Then Appleman should give Toastman some coins depending on the chosen cards…
B. Fox And Jumping time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Fox Ciel is playing a game. In this game there is an infinite long tape with cells indexed by integers (positive, negativ…
A. Fox and Box Accumulation time limit per test:1 second memory limit per test:256 megabytes Fox Ciel has n boxes in her room. They have the same size and weight, but they might have different strength. The i-th box can hold at most xi boxes on its t…
题目链接:http://codeforces.com/problemset/problem/510/B 题目意思:给出 n 行 m 列只有大写字母组成的字符串.问具有相同字母的能否组成一个环. 很容易知道要用到深搜.暴力搜索--- #include <iostream> #include <cstdio> #include <cstdlib> #include <cstring> using namespace std; + ; char g[maxn][m…
http://codeforces.com/contest/389/problem/E 题意:给你n个序列,然后两个人x,y,两个人玩游戏,x从序列的前面取,y从序列的后面取,两个人都想自己得到的数的和尽可能大,最后输出两个人得到的数的和. 思路:如果序列的个数为偶数的话,前面一半为x所得,后面一半为y所得: 如果为奇数的话,中间的数根据它的大小决定谁得到.这样的处理方式因为两个人都尽可能的取得序列中的最大,在谁的那一半数大的,另一个人取不到,有的时候可以先放一放,去取别人即将取到的数. #in…
388A - Fox and Box Accumulation 思路: 从小到大贪心模拟. 代码: #include<bits/stdc++.h> using namespace std; const int INF=0x3f3f3f3f; ; int a[N]; bool vis[N]={false}; int main() { ios::sync_with_stdio(false); cin.tie(); int n; ; cin>>n; ;i<n;i++) { cin&…
B. Fox And Two Dots time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Fox Ciel is playing a mobile puzzle game called "Two Dots". The basic levels are played on a board of size n × m ce…