UVA 111 History Grading】的更多相关文章

题目连接:111 - History Grading 题目大意:给出一个n 代表序列中元素的个数, 然后是一个答案, 接下来是若干个同学的答案(直到文件结束为止), 求出两个序列的最长公共子序列, 注意给出的答案均是以该事件处于第几个发生的, 例如 :2 3 4 1 即是 对应第1个事件在第2个发生,第2个事件在第3个发生 ...转换一下就是  4 1 2 3. 解题思路:最长公共子序列问题, 状态转移方程 d[i][j] = 0( i == 0 ||  j == 0) d[i - 1] [j…
 History Grading  Background Many problems in Computer Science involve maximizing some measure according to constraints. Consider a history exam in which students are asked to put several historical events into chronological order. Students who order…
读题读了好久,其实就是在输入数据时要对数据的位置进行相应的改变 #include<iostream> #include<cstring> #include<cstdio> using namespace std; ], arr[], d[][]; int main() { int n, t; scanf("%d",&n); // 读入正确的答案顺序 ; i<n; ++i) { scanf("%d",&t);…
题目链接 题意:给N,第二行是答案,n个数c1---cn, 代表第一个的顺序是c1,第二个数顺序是c2; 下面每一行是学生的答案,格式同上. 注意:这个给的顺序需要处理一下,不能直接用. 思路:LCS. #include <iostream> #include <cstdio> #include <cstring> #include <cstdlib> #include <algorithm> using namespace std; #defi…
题意:题意就是坑,看不大懂么,结果就做不对,如果看懂了就so easy了,给定n个事件,注意的是, 它给的是第i个事件发生在第多少位,并不是像我们想的,第i位是哪个事件,举个例子吧,4 2 3 1, 表示的是第一个事件发生在第四,第二个事件发生在第二位,第三个在第三位,第四个在第一位. 然后输入n个答案,求有多少个事件相对位置是和原来一样的. 那么知道输入好办了,我们只需对输入做一下预处理,就变成了LIS. 代码如下: #include <iostream> #include <cstd…
题目描述 在信息科学中有一些是关于在某些条件限制下,找出一些计算的最大值. 以历史考试来说好了,学生被要求对一些历史事件根据其发生的年代顺序来排列.所有事件顺序都正确的学生无疑的可以得满分.但是那些没有全对的人又该如何给分呢?以下有2种可能的给分方式: 1. 每个与标准答案的顺序相同的事件得1分 2. 每个在最长(但不一定要连续)的序列事件中,其相对的顺序亦可以在标准答案发现者,每个事件得1分. 举例说明:如果有4个事件其发生时间的顺序依次是1 2 3 4(就是标准答案啦,意思是第1个事件发生顺…
 History Grading  Background Many problems in Computer Science involve maximizing some measure according to constraints. Consider a history exam in which students are asked to put several historical events into chronological order. Students who order…
 History Grading  Background Many problems in Computer Science involve maximizing some measure according to constraints. Consider a history exam in which students are asked to put several historical events into chronological order. Students who order…
uva111:http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=24&page=show_problem&problem=47 题意:看懂之后就是求两个串的最长公共子串. 题解:不过这里要注意一下,就是题目中假如说第一个数是2,表示事件1应该放在第二个位子,这样转化一下就可以了.以前集训的时候也搞过这样的东西,但是年代久远,往事早已随风而去.今天复习了一下,发现很简单的…
题目描述 输入两个DFA,判断是否等价. https://uva.onlinejudge.org/external/16/1671.pdf 输入 第一行T 可以接受的字母表 第二行N 状态数 接下去N行 每个状态的情况 第一个表示是否为接受状态 后面T个是接受字母i可以转移到的状态 -1表示不转移 输出 等价输出Yes,不等价输出No 样例输入 2 3 1 -1 1 0 -1 2 0 -1 0 2 1 -1 1 0 -1 0 3 4 1 -1 -1 1 1 -1 -1 2 1 -1 -1 3 1…