摘要: A. The Doors time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output A. The Doors time limit per 阅读全文
posted @ 2019-04-18 00:35 叶坚持 阅读(354) 评论(0) 推荐(0)
摘要: 数学解释: 数论中的重要概念。给定一个正整数m,如果两个整数a和b满足a-b能够被m整除,即(a-b)/m得到一个整数,那么就称整数a与b对模m同余, 同余定理:两个整数同时除以一个整数得到的余数相同,则二整数同余。记作a ≡ b(mod m)。 实际上我们在ACM只要记住两个公式即可:(只对“+” 阅读全文
posted @ 2019-04-16 23:13 叶坚持 阅读(4569) 评论(2) 推荐(0)
摘要: A. Thanos Sort time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Thanos sort is a supervill 阅读全文
posted @ 2019-04-16 00:32 叶坚持 阅读(472) 评论(0) 推荐(0)
摘要: Given a tree, you are supposed to list all the leaves in the order of top down, and left to right. Input Specification: Each input file contains one t 阅读全文
posted @ 2019-04-16 00:28 叶坚持 阅读(428) 评论(0) 推荐(0)
摘要: A. Serval and Bus time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output It is raining heavily. 阅读全文
posted @ 2019-04-14 23:11 叶坚持 阅读(438) 评论(0) 推荐(0)
摘要: B. Serval and Toy Bricks time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output B. Serval and To 阅读全文
posted @ 2019-04-14 23:06 叶坚持 阅读(350) 评论(0) 推荐(0)
摘要: 给定两个由英文字母组成的字符串 String 和 Pattern,要求找到 Pattern 在 String 中第一次出现的位置,并将此位置后的 String 的子串输出。如果找不到,则输出“Not Found”。 本题旨在测试各种不同的匹配算法在各种数据情况下的表现。各组测试数据特点如下: 数据0 阅读全文
posted @ 2019-04-14 20:21 叶坚持 阅读(810) 评论(0) 推荐(0)
摘要: 在这一章中,老师教了我们四种数据结构:BF算法,kmp算法,三元组和十字链表;还给我们讲了2019年团体天体赛中T1-8的AI题 1、对于BF和kmp算法,老师除了在课堂上讲解算法的主要核心思想外,还给了我们一道作业题去巩固; 这道题如下: 7-1 串的模式匹配 (30 分) 7-1 串的模式匹配 阅读全文
posted @ 2019-04-14 19:49 叶坚持 阅读(1575) 评论(2) 推荐(0)
摘要: 7-1 稀疏矩阵 (30 分) 7-1 稀疏矩阵 (30 分) 7-1 稀疏矩阵 (30 分) 如果一个矩阵中,0元素占据了矩阵的大部分,那么这个矩阵称为“稀疏矩阵”。对于稀疏矩阵,传统的二维数组存储方式,会使用大量的内存来存储0,从而浪费大量内存。为此,可以用三元组的方式来存放一个稀疏矩阵。 对于 阅读全文
posted @ 2019-04-14 19:25 叶坚持 阅读(16908) 评论(0) 推荐(2)
摘要: 给定一个主串S(长度<=10^6)和一个模式T(长度<=10^5),要求在主串S中找出与模式T相匹配的子串,返回相匹配的子串中的第一个字符在主串S中出现的位置。 输入格式: 输入有两行: 第一行是主串S; 第二行是模式T. 输出格式: 输出相匹配的子串中的第一个字符在主串S中出现的位置。若匹配失败, 阅读全文
posted @ 2019-04-08 23:28 叶坚持 阅读(4485) 评论(4) 推荐(1)