poj2352,poj 3087 Shuffle'm Up 模拟(map记录)
题意:已知两堆牌数均为n的纸牌堆a和b的初始状态, 按给定规则能将他们相互交叉组合成一堆牌str,再将str的最底下的n张牌归为a,最顶的n张牌归为b,依此循环下去。现在输入a和b的初始状态 以及 预想的最终状态c,问a, b经过多少次洗牌之
时间:2023-09-22  |  阅读:28
poj2352,poj 1733 ParityGame 并查集 离散化
这道题poj1733 和 hdu 3038类似,闭区间那里的原理相同。 本题的两段代码的区别只有find()函数不同 但是感觉没有区别的呀 poj2352,AC: int find(int x) {if (par[x] == -1)return x;int tmp = find(par[x]);val[x] ^= val[par[x]];return par[x] 
时间:2023-09-22  |  阅读:28
poj2106,poj  1191
这道题目心得,学会怎么求一个矩阵从(x1,y1)到(x2,y2)的数字的总和,并且还有结合动态规划, #include"stdafx.h"#include <stdio.h> #include <math.h> #include <algorithm> using namespace std; int matrix[8][8]; in
时间:2023-09-20  |  阅读:28
poj1741,poj 2255 Tree Recovery
#include <iostream> //给出先序和中序遍历序列,输出后序遍历序列#include <string.h>using namespace std;const int MAXLEN=100;void build(int len,char* s1,char* s2,char* s) //s1,s2和s都是在不断变化,所以s1[0]...也随之不同{if(len<=0)return
时间:2023-09-20  |  阅读:25
poj2352,poj 2192
题意:给出两串,两串顺序不变看能否组成第三个串。 此题深搜和DP都能解决: 深搜的话需要几个强有力剪枝条件 1、 第三个串最后一个字符要么是串1的最后一个字符,要么是串2的最后一个字符 2、 按照串1的顺序对串3进行搜索,若不匹配则该字符
时间:2023-09-20  |  阅读:25
poj2352,poj  1068 Parencodings (模拟)
题意: 先输入右括号前左括号的数量 poj2352。 输出每个括号所含括号的数量(从左至右) 思路: 由于以前模拟题留下太大的阴影,比较凌乱:没想到今天 模拟1Y poj1741, 虽然题简单点,就是用-1 1 模拟 括号 ,向前搜索即
时间:2023-09-20  |  阅读:28
poj1741,poj 3278  Catch That Cow (bfs)
题目:http://poj.org/problem?id=3278 题意: 给定两个整数n和k 通过 n+1或n-1 或n*2 这3种操作,使得n==k poj1741。输出最少的操作次数 1 #include<stdio.h> 2 #include<string.h> 3 #include<queue> 4 using namespa
时间:2023-09-20  |  阅读:25
java基本语法实验报告,poj  1325 Machine Schedule  解题报告
题目链接:http://poj.org/problem?id=1325 题目意思:有 k 个作业,机器A有 n 个模式:0 ~ n-1,机器B 有 m 个模式:0~ m-1。每一个作业能运行在 A 的 某一个模式(假设为 i (0 <= i <= n-1 ) )或 B 的
时间:2023-09-20  |  阅读:18
poj1741,POJ 1306
其实求的这个数的式子化简一下,就是C(N,M)..... #include <iostream> #include <algorithm> #include <cstdio> #define LL __int64 using namespace std;LL N,M;LL myc(LL n,LL r){LL sum=1;for(LL i=1;i<=r;i++)sum=su
时间:2023-09-20  |  阅读:20
poj  Balanced Lineup  RMQ
Balanced Lineup Description For the daily milking, Farmer John'sNcows (1 ≤N≤ 50,000) always line up in the same order. One day Farmer John decides to organize a game of Ultimate Frisbee with some of the cows. To keep things simple, he will take a co
时间:2023-09-19  |  阅读:15

本站为非赢利网站,部分文章来源或改编自互联网及其他公众平台,主要目的在于分享信息,版权归原作者所有,内容仅供读者参考,如有侵权请联系我们删除!

Copyright © 2022 匯編語言學習筆記 Inc. 保留所有权利。

底部版权信息