UVA, 10336 Rank the Languages】的更多相关文章

难点在于:递归函数和输出: #include <iostream> #include <vector> #include <algorithm> #include <map> using namespace std; class Rank{ private: int length,width,ans=0; char c; vector <char> v; int a[26][1000]; map <char,int> m; //out…
题目描述 输入两个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…
题目链接:传送门 题意: 给你两个集合A,B,任意组合成新的集合C(去重) 问你最后C集合大小 题解: 暴力 组成的新串hash起来 #include<bits/stdc++.h> using namespace std; #pragma comment(linker, "/STACK:102400000,102400000") #define ls i<<1 #define rs ls | 1 #define pii pair<int,int> #…
容错声明: ①题目选自https://acm.ecnu.edu.cn/,不再检查题目删改情况 ②所有代码仅代表个人AC提交,不保证解法无误 E0001  A+B Problem First AC: 2017-10-13       Latest Modification: 2018-02-28 #include<bits/stdc++.h> using namespace std; int a,b; int main() { cin>>a>>b; cout<<…
2534: Uva10829L-gap字符串 Time Limit: 10 Sec  Memory Limit: 128 MBSubmit: 177  Solved: 66[Submit][Status][Discuss] Description 有一种形如uvu形式的字符串,其中u是非空字符串,且V的长度正好为L,那么称这个字符串为L-Gap字符串 给出一个字符串S,以及一个正整数L,问S中有多少个L-Gap子串. Input 第一行一个数字L 第二行一个字符串S Output 一个数字表示S…
1: UVa 10887 - Concatenation of Languages map 可以做 ,但是输入实在恶心,有空串之类的HASH模板: int Hash(char *s){   int seed=131,sum=0;   while (*s)   sum=sum*seed+(*s++);   return (sum&0x7FFFFFFF)%N;} void hash_insert(int s){   int h=Hash(c[s]);   int u=head[h];   while…
题目来源:https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=3&page=show_problem&problem=48 Tree Summing  Background LISP was one of the earliest high-level programming languages and, with FORTRAN, is one of the olde…
这道题目甚长, 代码也是甚长, 但是思路却不是太难.然而有好多代码实现的细节, 确是十分的巧妙. 对代码阅读能力, 代码理解能力, 代码实现能力, 代码实现技巧, DFS方法都大有裨益, 敬请有兴趣者耐心细读.(也许由于博主太弱, 才有此等感觉). 题目: UVa 1103 In order to understand early civilizations, archaeologists often study texts written in  ancient languages. One…
 A Puzzling Problem  The goal of this problem is to write a program which will take from 1 to 5 puzzle pieces such as those shown below and arrange them, if possible, to form a square. An example set of pieces is shown here. The pieces cannot be rota…
UVA - 120  Stacks of Flapjacks Time Limit: 3000MS   Memory Limit: Unknown   64bit IO Format: %lld & %llu Description Background Stacks and Queues are often considered the bread and butter of data structures and find use in architecture, parsing, oper…