Two students are playing the following game. There are 2· n points on the plane, given with their coordinates ( xi,  yi). Each move player paints the point with his own color (first with white, second with black). The first student makes odd moves, s…
链接: http://acm.timus.ru/problem.aspx?space=1&num=1303 http://acm.hust.edu.cn/vjudge/contest/view.action?cid=26733#problem/D D - Minimal Coverage Time Limit:1000MS     Memory Limit:65536KB     64bit IO Format:%I64d & %I64u Submit Status Practice UR…
如果硬要说这算是博弈题目的话,那这个博弈是不公平博弈(partizan games),因为双方面对同一个局面做出来的决策是不一样的. 我们平时做的博弈都是公平博弈(impartial games),所以在这道题里面,那些必胜必败状态,SG函数SG定理都派不上用场了. 但是,这道题是可以贪心的. 比如第一个图案对于Alice来说是安全稳定的,因为Bob不会跟他去抢位置,所以Alice可以省到最后去放.同样地,Bob可以将第2个图案省到最后再去放. 比如说第15个图案,如果能抢先占到的话会很划算的,…
题目描述: Match Points time limit per test 2 seconds memory limit per test 256 mega bytes input standard input output standard output You are given a set of points x1, , ..., *x**n* Two points iand jcan be matched with each other if the following conditi…
题目链接 #include<iostream> #include<cstdio> using namespace std; typedef long long ll; int main() { ll n; while(~scanf("%I64d",&n)) {//其实算是 贪心了吧 //先手想赢,他会x2,这样子才能尽量避免让后手赢 //后手想赢,他就会x9,只有乘最大的,他胜算才最大 ; ll l=,r=; ) { if(n>=l&&am…
Scientific Conference 之前一直在刷计算几何,邀请赛连计算几何的毛都买见着,暑假这一段时间就做多校.补多校的题目.刷一下一直薄弱的DP.多校假设有计算几何一定要干掉-.- 题意:给你N个报告会的開始时间跟结束时间.问你做多能够听几场报告会.要求报告会之间至少间隔为1. 思路:事实上是个活动安排问题.能够用贪心也能够用DP,贪心写起来会比較简单一些.由于练习DP,所以又用DP写了一遍. 贪心的话就是一个非常easy的活动选择问题,从结束时间入手,找每次的最优选择. 贪心: st…
2021. Scarily interesting! Time limit: 1.0 secondMemory limit: 64 MB This year at Monsters University it is decided to arrange Scare Games. At the Games all campus gathers at the stadium stands, and the Scare program students divide into two teams to…
题目地址:Ural 1303 先按每一个线段的左端点排序,然后设置一个起点s.每次都从起点小于等于s的线段中找到一个右端点最大的. 并将该右端点作为新的起点s,然后继续找. 从左到右扫描一遍就可以. 代码例如以下: #include <iostream> #include <cstdio> #include <string> #include <cstring> #include <stdlib.h> #include <math.h>…
Our chemical biologists have invented a new very useful form of life called stripies (in fact, they were first called in Russian - polosatiki, but the scientists had to invent an English name to apply for an international patent). The stripies are tr…
URAL 1303 思路: dp+贪心,然后记录路径 mx[i]表示从i开始最大可以到的位置 sufmx[i]表从1-i的某个位置开始最大可以到达的位置 比普通的贪心效率要高很多 代码: #include<bits/stdc++.h> using namespace std; #define ll long long #define pb push_back #define mp make_pair #define pii pair<int,int> #define mem(a,b…