题目:给定一个n*m大的纸张,上面表明了每块上的字母,在其背后给定了对应位置的字母的value,在最后给出需要剪出来的剪纸的字母序列。
方法:暴力搜索。
代码:
#include
#include
#include
#include
using namespace std;
char map[502][502];
int Map[502][502];
int vis[502][502...
分类:
其他好文 时间:
2014-05-05 12:53:36
阅读次数:
338
题目是选出c个连续的囚犯,而且囚犯的级别不能大于t#include using namespace
std;int main(){ int n,t,c; cin >> n >> t >> c; int a,cnt = 0,
res =0;; for(int i = 0 ; i...
分类:
其他好文 时间:
2014-05-04 12:14:55
阅读次数:
340
LTC男人八题系列,测试数据之强真不是盖的。题目大意是在树上找出所有满足长度 2
#include 3 using namespace std; 4 5 6 #define FOR(p,i,s,t) for(__typeof(p) i=s;
it, Vs[eptr].l = this...
分类:
其他好文 时间:
2014-05-03 22:47:34
阅读次数:
419
题意:给定背包体积与物品的体积与价值 求正好放完的最小价值#includeusing
namespace std;int min(int a,int b){ if(a>t; while(t--) {
cin>>m1>>m2; m=m2-m1; ...
分类:
其他好文 时间:
2014-05-03 22:37:20
阅读次数:
437
题意:求最大上升子序列和#includeusing namespace std;int
main(){ int n,a[1001],b[1001],max; while(cin>>n&&n!=0) { for(int
i=1;i>a[i]; b[1]=a...
分类:
其他好文 时间:
2014-05-03 22:29:38
阅读次数:
282
#pragma once#include namespace stds { class tool
{ public: std::string ws2s(const std::wstring& ws) { std::string curLocale =
setlocale(LC_ALL...
分类:
其他好文 时间:
2014-05-03 22:25:17
阅读次数:
318
题目链接:1372 - Log Jumping
题意:给定一些n个木板的起始位置和长度k,相重叠的木板可以互相跳跃,求能构成环的最大数量。
思路:先按起始位置排序,然后每次多一个木板就去判断他和前一个和前前一个能不能互相跳跃,如果可以的话就可以多加上这个木板。
代码:
#include
#include
#include
using namespace std;
#define ma...
分类:
其他好文 时间:
2014-05-03 21:44:03
阅读次数:
247
【分析】
【伪代码】
【运行过程】
【代码】
/*********************************
* 日期:2014-04-01
* 作者:SJF0115
* 题目:快速排序
**********************************/
#include
#include
using namespace...
分类:
其他好文 时间:
2014-05-03 21:17:50
阅读次数:
476
在输入密码时,实现有限次密码输入的限制,如果三次都没有输入正确,程序将直接退出,不允许用户继续操作。
#include
#include
using namespace std;
int main()
{
string pwd;
int cLogin=0;
do
{
cout<>pwd;
if (pwd!="123")
{
...
分类:
编程语言 时间:
2014-05-03 17:45:26
阅读次数:
354
题目:经典dp题目,求出最大相邻子序列的和。
方法:给出两种方法,一种dp,一种直接暴力(数据量小的时候可以考虑)。
代码1:
#include
#include
using namespace std;
int main()
{
int n;
int t=1;
cin>>n;
int s[100010];
while(t<=n)
{
...
分类:
其他好文 时间:
2014-05-03 17:02:34
阅读次数:
324