题目链接: http://codeforces.com/problemset/problem/498/C C. Array and Operations time limit per test1 secondmemory limit per test256 megabytes 问题描述 You have written on a piece of paper an array of n positive integers a[1], a[2], ..., a[n] and m good pair
赛后补题,还是要经常回顾,以前学过的匈牙利都忘记了,“猪队友”又给我讲了一遍... 怎么感觉二分图的匈牙利算法东西好多啊,啊啊啊啊啊啊啊啊啊(吐血...) 先传送一个写的很好的博客,害怕智障找不到了.大神膜%%% Orz H - Words from cubes Informikas was cleaning his drawers while he found a toy of his childhood. Well, it's not just a toy, it's a bunch
pi只有0-5000且只找最小的没出现的,又要找不同club的,考虑二分匹配,左边pi,右边ci,一个匹配一个.离线倒着加边即可. const int maxn = 5e3 + 5; int m, n, d, now; int P[maxn], C[maxn], K[maxn]; int match[maxn], ans[maxn]; bool mark[maxn], used[maxn]; vector<int> G[maxn]; bool dfs(int cur) { if (used[c
题目链接:http://codeforces.com/contest/489 A:SwapSort In this problem your goal is to sort an array consisting of n integers in at most n swaps. For the given array find the sequence of swaps that makes the array sorted in the non-descending order. Swaps
Codeforces 382E Ksenia and Combinatorics Ksenia has her winter exams. Today she is learning combinatorics. Here's one of the problems she needs to learn to solve. How many distinct trees are there consisting of n vertices, each with the following pro
Codeforces Round #272 (Div. 2) A. Dreamoon and Stairs time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Dreamoon wants to climb up a stair of n steps. He can climb 1 or 2 steps at each move.
目录 @description@ @solution@ @accepted code@ @details@ @description@ 给定 n 个互不相同的只包含 'a', 'b' 的字符串. 请选出最多的字符串,使得字符串两两之间没有包含关系(即不存在两个字符串 s, t 使得 s 是 t 的子串). 输出方案. Input 第一行一个整数 n (1 ≤ n ≤ 750) 表示字符串个数. 接下来 n 行每行一个只包含 'a', 'b' 的字符串.保证 n 个字符串总长不超过 10^7. O