[topcoder]SRM 646 DIV 2

第一题:K等于1或者2,非常简单。略。K更多的情况,http://www.cnblogs.com/lautsie/p/4242975.html,值得思考。

第二题:http://www.cnblogs.com/lautsie/p/4245242.html

BFS和DFS都可以,注意的是,写的时候,可以往que里几个东西一起扔,就不用建立对象了。也可以直接用二维矩阵记录blocked和visited。

剪枝什么的,最基本的是发现其实在步数限制的情况下,棋盘就是有界的了。

第三题:http://apps.topcoder.com/wiki/display/tc/SRM+646#TheFootballDivTwo

分析很好,就是首先找到怎么比位置都不会变的,让他们赢两场,然后找到可以让别人赢一场的。这样就是剩下的胜利场次的分配了。分配给一个队后,反正已经落后他了,就分两场给他。

时间: 2024-10-17 19:53:34

[topcoder]SRM 646 DIV 2的相关文章

TopCoder SRM 634 Div.2[ABC]

TopCoder SRM 634 Div.2[ABC] ACM 题目地址: TopCoder SRM 634 赛后做的,感觉现场肯定做不出来Orz,简直不能多说. Level One-MountainRanges[水题] 题意: 问序列中有几个完全大于旁边的峰. 分析: 傻逼题,不多说. 代码: /* * Author: illuz <iilluzen[at]gmail.com> * File: one.cpp * Create Date: 2014-09-26 21:01:23 * Desc

TopCoder SRM 628 DIV 2

250-point problem Problem Statement    Janusz is learning how to play chess. He is using the standard chessboard with 8 rows and 8 columns. Both the rows and the columns are numbered 0 through 7. Thus, we can describe each cell using its two coordina

TopCoder SRM 560 Div 1 - Problem 1000 BoundedOptimization &amp; Codeforces 839 E

传送门:https://284914869.github.io/AEoj/560.html 题目简述: 定义"项"为两个不同变量相乘. 求一个由多个不同"项"相加,含有n个不同变量的式子的最大值. 另外限制了每一个变量的最大最小值R[i]和L[i]和所有变量之和的最大值Max. n<=13 题外话: 刚开始做这道题的时候,感觉意外眼熟? codeforces 839 E(此题的退化版):http://codeforces.com/contest/839/pro

[topcoder]SRM 633 DIV 2

第一题,http://community.topcoder.com/stat?c=problem_statement&pm=13462&rd=16076 模拟就可以了. #include <vector> #include <algorithm> using namespace std; class Target { public: vector <string> draw(int n) { vector<string> result(n,

Topcoder SRM 648 (div.2)

第一次做TC全部通过,截图纪念一下. 终于蓝了一次,也是TC上第一次变成蓝名,下次就要做Div.1了,希望div1不要挂零..._(:зゝ∠)_ A. KitayutaMart2 万年不变的水题. #include<cstdio> #include<cstring> #include<cmath> #include<iostream> #include<algorithm> #include<set> #include<map&

TopCoder SRM 596 DIV 1 250

body { font-family: Monospaced; font-size: 12pt } pre { font-family: Monospaced; font-size: 12pt } Problem Statement      You have an array with N elements. Initially, each element is 0. You can perform the following operations: Increment operation:

Topcoder SRM 687 (Div 2) 250.Quorum

Problem Statement   In one organization they have n different committees. The organization has a very large number of employees. Each employee is a member of each committee. Each committee has a quorum: the smallest number of members that have to be

Topcoder SRM 687 (Div 2) 500.Quacking

Problem Statement   Ducks have started mysteriously appearing in your room. All ducks make the same sound: "quack". Each duck makes the sound one or more times, one after another. For example, valid sounds for a single duck are "quack"

TopCoder SRM 144 DIV 2

200: Problem Statement   Computers tend to store dates and times as single numbers which represent the number of seconds or milliseconds since a particular date. Your task in this problem is to write a method whatTime, which takes an int, seconds, re