CF388C Fox and Card Game】的更多相关文章

基于观察可以发现,双方都一定能保证取到每一列靠近自己的 \(\lfloor \frac{k}{2} \rfloor\) 个元素. 那么一旦一个人想要取另一个人能必然能取的部分,另一个人必然可以不让其取到. 因此,一个人去取对方一定能取到的部分是无意义的. 因此双方的策略必然都是先将靠近自身的 \(\lfloor \frac{k}{2} \rfloor\) 个元素取完,在抢中间剩下的元素. 那么对于最后剩下的元素,每次贪心的选择一定是最优的,因此双方的选择必然都是每次选取当前最大的元素. 那么我们…
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…
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…
http://codeforces.com/contest/389/problem/E 题意:给你n个序列,然后两个人x,y,两个人玩游戏,x从序列的前面取,y从序列的后面取,两个人都想自己得到的数的和尽可能大,最后输出两个人得到的数的和. 思路:如果序列的个数为偶数的话,前面一半为x所得,后面一半为y所得: 如果为奇数的话,中间的数根据它的大小决定谁得到.这样的处理方式因为两个人都尽可能的取得序列中的最大,在谁的那一半数大的,另一个人取不到,有的时候可以先放一放,去取别人即将取到的数. #in…
做codeforces以来题目最水的一次 A题: Fox and Number Game 题意:就是用一堆数字来回减,直到减到最小值为止,再把所有最小值加,求这个值 sol: 简单数论题目,直接求所有数字的最大公约数即可 ps: 以前cf出过这道题目啊,出题人没救了 5分钟300人过  ; ? a : gcd(b,a%b);  }   {           )      {          ;i<n;i++) scanf(         ];          ;i<n;i++)    …
D. Fox And Jumping 题目连接: http://codeforces.com/contest/510/problem/D Description Fox Ciel is playing a game. In this game there is an infinite long tape with cells indexed by integers (positive, negative and zero). At the beginning she is standing at…
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…
Text Postcards always spoil my holidays. Last summer, I went to Italy. I visited museums and sat in public gardens. A friendly waiter taught me a few words of Italian. Then he lent me a book. I read a few lines, but I did not understand a word. Every…
1.CardIO 识别 框架 GitHub 下载地址 配置 1.把框架整个拉进自己的工程,然后在 TARGETS => Build Phases => Link Binary With Libraries 里边分别加入下面这几个框架. Accelerate.framework MobileCoreServices.framework CoreMedia.framework AudioToolbox.framework AVFoundation.framework 2.在TARGETS =>…