# Lruihao's Note

## poj-1321 棋盘问题（dfs）

Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 63659 Accepted: 30423 1 Description在一个给定形状的棋盘（形状可能是不规则的）上面摆放棋子，棋子没有区别。要求摆放时任意的两个棋子不能放在棋盘中的同一行或者同一列，请编程求解对于给定形状和大小的棋盘，摆放 k 个棋子的所有可行的摆放方案 C。 2 Input输入含有多组测试数据。 每组数据的第一行是两

## poj-1426-Find The Multiple(dfs)

1 Find The MultipleTime Limit: 1000MS Memory Limit: 10000K Total Submissions: 40713 Accepted: 17088 Special Judge 1.1 DescriptionGiven a positive integer n, write a program to find out a nonzero multiple m of n whose decimal representation contains only the digits 0 and 1. You may assume that n is not greater than 200 and there is a corresponding m containing no more than 100 decimal digits. 1.2 InputThe input file may contain multiple test cases. Each line contains a value of n (1 <= n <= 200). A line containing a zero terminates the input. 1.3 OutputFor each value of n in the input print a line containing the corresponding value of m. The decimal representation of m must not contain more than 100 digits. If there are multiple solutions for a given value of n, any one of them is acceptable. 1.4 Sample Input2 6 19 0 1.5

A. Adjacent Replacements 第一次打 cf 就做出一道这样的找规律的题，打到自闭。 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 #include<bits/stdc++.h> using namespace std; int main(){ int n,a[1001]; cin>>n; int i; int flag=0; for(i=0;i<n;i++){ cin>>a[i]; if(!(a[i]&1)) a[i]--; if(!flag) {cout<<a[i];flag=1;} else cout<<" "<<a[i]; } return 0; }

## hdu-1241-Oil Deposits (dfs)

1 Oil Deposits翻译 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 41406 Accepted Submission(s): 23977 1.1 Problem DescriptionThe GeoSurvComp geologic survey company is responsible for detecting underground oil deposits. GeoSurvComp works with one large rectangular region of land at a time, and creates a grid that divides the land into numerous square plots. It then analyzes each plot separately, using sensing equipment to determine whether or not the plot contains oil. A plot containing oil is called a pocket. If two pockets are adjacent, then they are part of the same oil deposit. Oil deposits can be quite large and may contain numerous pockets. Your job is to determine how many different oil deposits are contained in a grid. 1.2 InputThe input file contains one or more grids. Each grid begins with a line containing m and

## TaoTao 要吃鸡

2018 年全国多校算法寒假训练营练习比赛（第二场）B(0 1 背包变化 特殊处理一个物品） 链接：https://www.nowcoder.com/acm/contest/74/B 来源：牛客网 1 题目描述Taotao 的电脑带不动绝地求生，所以 taotao 只能去玩 pc 版的荒野行动了，和绝地求生一样，游戏人物本身可以携带一定重量 m