Skip to main content
  1. Tags/

Brute Force

2017

2016

seerc 2014 A Banks (暴力)

·1 min
题目链接 题意:n个数围成一圈,对于负数可以进行magic操作,也就是取反,但是会影响到左右相邻的,加上这个负数。问最少进行多少次magic操作,使得所有数都是非负。

codeforces #346 div 2 C. Tanya and Toys (暴力乱搞)

·2 mins
题目链接 题意:有1E9个礼物,第i个礼物价钱是i,然后现在已经有n个不重复的礼物,a[i],m元钱,想尽可能多得买不同种类的礼物,还能买多少个。 思路:先不考虑已经买的,从1连续买到k,然后考虑子啊这个区间内已经买的,等于实际上没有花钱。 反正就是暴力搞啊搞啊。。我也不知道怎么搞。。 结果最后。。方案数为0的时候。。。最后一个答案我是单独输出的。。忘了判断了。。。所以会输出两个0.宝宝心里苦啊。。。。。。。。

codeforces 334 B. Eight Point Sets (暴力)

·1 min
题目链接 题意:给出8个点,问能否构成一个8元素集合,使得x1/* *********************************************** Author :111qqz Created Time :2016年03月31日 星期四 13时39分27秒 File Name :code/cf/problem/334B.cpp ************************************************ */

codeforces croc2016 A. Amity Assessment (暴力)

·1 min
题目链接 题意:2×2的格子,有三个位置分别放”A“ “B” “C” ,一个位置为空。只有和空位相邻位置上的字母能移动到空位。没有其他移动规则。现在给出两个状态。问能否互相转化。 思路: 貌似可以dfs…?但是一共才2*2,可以直接暴力枚举。 手写一种变换最多能有12种。

codeforces #341 div2 A. Die Roll

·1 min
http://codeforces.com/contest/621/problem/A A. Wet Shark and Odd and Even time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Today, Wet Shark is given n integers. Using any of these integers no more than once, Wet Shark wants to get maximum possible even (divisible by 2) sum. Please, calculate this value for Wet Shark.

codeforces #341 div 2 B. Wet Shark and Bishops

·2 mins
http://codeforces.com/contest/621/problem/B B. Wet Shark and Bishops time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Today, Wet Shark is given n bishops on a 1000 by 1000 grid. Both rows and columns of the grid are numbered from 1 to 1000. Rows are numbered from top to bottom, while columns are numbered from left to right.

uva 120 Stacks of Flapjacks

·2 mins
https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid;=8&page;=show_problem&problem;=56 题意:给出一个长度为n的序列(无重复元素),询问经过多少次flip(i)操作,使得序列升序排列。定义flip(i)为将1到n-i+1的元素反转… 思路:先离散化,然后注意读入….