poj 2046 Gap(bfs+hash)】的更多相关文章

Description Let's play a card game called Gap. You have cards labeled with two-digit numbers. The first digit ( to ) represents the suit of the card, and the second digit ( to ) represents the value of the card. First, you shu2e the cards and lay the…
http://www.lydsy.com/JudgeOnline/problem.php?id=1054 一开始我还以为要双向广搜....但是很水的数据,不需要了. 直接bfs+hash判重即可. #include <cstdio> #include <cstring> #include <cmath> #include <string> #include <iostream> #include <algorithm> using n…
10798 - Be wary of Roses You've always been proud of your prize rose garden. However, some jealous fellow gardeners will stop at nothing to gain an edge over you. They have kidnapped, blindfolded, and handcuffed you, and dumped you right in the middl…
Pots Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 10071   Accepted: 4237   Special Judge Description You are given two pots, having the volume of A and B liters respectively. The following operations can be performed: FILL(i)        f…
Pots Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 11705   Accepted: 4956   Special Judge Description You are given two pots, having the volume of A and B liters respectively. The following operations can be performed: FILL(i)        f…
题目链接 字符串hash判断字符串是否相等. code #include<cstdio> #include<algorithm> #include<cstring> using namespace std; typedef unsigned long long uLL; ; uLL f[]; uLL Hash[]; ],b[]; int main () { int T; scanf("%d",&T); f[] = ; ; i<=; ++…
思路:宽度优先搜索(BFS算法) #include<iostream> #include<stdio.h> #include<cmath> #include<cstring> using namespace std; int a,b; struct node{ int num; int step; }; node que[10000];//默认初始化为0 int visit[10000];//默认初始化为0 int prime(int d){ if(d<…
1.这道题学了个单词,product 还有 乘积 的意思.. 题意就是在一个 m*n的矩阵中,放入L个敌军的伞兵,而我军要在伞兵落地的瞬间将其消灭.现在我军用一种激光枪组建一个防御系统,这种枪可以安装在一行(或者一列),并且安装在不同行(或者不同列)的费用是不一样的,枪的攻击范围是一行(或者一列).安装所有枪的费用是它们每个费用的“乘积”,现在求组建这个系统需要的最小费用. 2.与前面做的二分图的一道题有点相似(POJ - 3041 Asteroids(最小点覆盖数)).但是现在这道题在不同行(…
POJ 3279 Fliptile(翻格子) Time Limit: 2000MS    Memory Limit: 65536K Description - 题目描述 Farmer John knows that an intellectually satisfied cow is a happy cow who will give more milk. He has arranged a brainy activity for cows in which they manipulate an…
两题二分图匹配的题: 1.一个农民有n头牛和m个畜栏,对于每个畜栏,每头牛有不同喜好,有的想去,有的不想,对于给定的喜好表,你需要求出最大可以满足多少头牛的需求. 2.给你学生数和课程数,以及学生上的课,如果可以做到每个学生代表不同的课程并且所有的课程都被代表输出"YES"(学生能代表一门课当且仅当他上过). 1.POJ 1274 The Perfect Stall http://poj.org/problem?id=1274 和上一题过山车一样,也是二分图匹配的. 水题. #incl…