04 2019 档案

摘要:Bessie is out in the field and wants to get back to the barn to get as much sleep as possible before Farmer John wakes her for the morning milking. Be 阅读全文
posted @ 2019-04-30 23:07 叶坚持 阅读(243) 评论(0) 推荐(0)
摘要:There are N villages, which are numbered from 1 to N, and you should build some roads such that every two villages can connect to each other. We say t 阅读全文
posted @ 2019-04-30 22:52 叶坚持 阅读(172) 评论(0) 推荐(0)
摘要:You are a member of the space station engineering team, and are assigned a task in the construction process of the station. You are expected to write 阅读全文
posted @ 2019-04-30 00:37 叶坚持 阅读(267) 评论(0) 推荐(0)
摘要:The Head Elder of the tropical island of Lagrishan has a problem. A burst of foreign aid money was spent on extra roads between villages some years ag 阅读全文
posted @ 2019-04-30 00:34 叶坚持 阅读(274) 评论(0) 推荐(0)
摘要:著名的王牌间谍 007 需要执行一次任务,获取敌方的机密情报。已知情报藏在一个地下迷宫里,迷宫只有一个入口,里面有很多条通路,每条路通向一扇门。每一扇门背后或者是一个房间,或者又有很多条路,同样是每条路通向一扇门…… 他的手里有一张表格,是其他间谍帮他收集到的情报,他们记下了每扇门的编号,以及这扇门 阅读全文
posted @ 2019-04-22 21:13 叶坚持 阅读(1151) 评论(0) 推荐(0)
摘要:J. Grid Beauty time limit per test 3.0 s memory limit per test 256 MB input standard input output standard output J. Grid Beauty time limit per test 3 阅读全文
posted @ 2019-04-20 23:16 叶坚持 阅读(577) 评论(0) 推荐(0)
摘要:最朴素的求幂方法 也就是平常使用pow函数,最简单的实现就是一直累乘,可以得到这样的代码: 1 int Pow(int a,int b){ 2 3 int ans = 1; 4 5 for(int i = 0;i < b;i++){ 6 7 ans *= a; 8 9 } 10 11 return 阅读全文
posted @ 2019-04-20 22:20 叶坚持 阅读(7388) 评论(5) 推荐(1)
摘要:Problem Description Keke is currently studying engineering drawing courses, and the teacher has taught her how to find its volume through the three vi 阅读全文
posted @ 2019-04-20 00:55 叶坚持 阅读(859) 评论(0) 推荐(0)
摘要:C. Queen time limit per test 1 second time limit per test memory limit per test 256 megabytes memory limit per test input standard input input output 阅读全文
posted @ 2019-04-18 00:49 叶坚持 阅读(333) 评论(0) 推荐(0)
摘要:B. Nirvana time limit per test 1 second time limit per test memory limit per test 256 megabytes memory limit per test input standard input input outpu 阅读全文
posted @ 2019-04-18 00:38 叶坚持 阅读(324) 评论(0) 推荐(0)
摘要: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 叶坚持 阅读(360) 评论(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 叶坚持 阅读(4592) 评论(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 叶坚持 阅读(478) 评论(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 叶坚持 阅读(430) 评论(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 叶坚持 阅读(444) 评论(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 叶坚持 阅读(352) 评论(0) 推荐(0)
摘要:给定两个由英文字母组成的字符串 String 和 Pattern,要求找到 Pattern 在 String 中第一次出现的位置,并将此位置后的 String 的子串输出。如果找不到,则输出“Not Found”。 本题旨在测试各种不同的匹配算法在各种数据情况下的表现。各组测试数据特点如下: 数据0 阅读全文
posted @ 2019-04-14 20:21 叶坚持 阅读(814) 评论(0) 推荐(0)
摘要:在这一章中,老师教了我们四种数据结构:BF算法,kmp算法,三元组和十字链表;还给我们讲了2019年团体天体赛中T1-8的AI题 1、对于BF和kmp算法,老师除了在课堂上讲解算法的主要核心思想外,还给了我们一道作业题去巩固; 这道题如下: 7-1 串的模式匹配 (30 分) 7-1 串的模式匹配 阅读全文
posted @ 2019-04-14 19:49 叶坚持 阅读(1580) 评论(2) 推荐(0)
摘要:7-1 稀疏矩阵 (30 分) 7-1 稀疏矩阵 (30 分) 7-1 稀疏矩阵 (30 分) 如果一个矩阵中,0元素占据了矩阵的大部分,那么这个矩阵称为“稀疏矩阵”。对于稀疏矩阵,传统的二维数组存储方式,会使用大量的内存来存储0,从而浪费大量内存。为此,可以用三元组的方式来存放一个稀疏矩阵。 对于 阅读全文
posted @ 2019-04-14 19:25 叶坚持 阅读(16922) 评论(0) 推荐(2)
摘要:给定一个主串S(长度<=10^6)和一个模式T(长度<=10^5),要求在主串S中找出与模式T相匹配的子串,返回相匹配的子串中的第一个字符在主串S中出现的位置。 输入格式: 输入有两行: 第一行是主串S; 第二行是模式T. 输出格式: 输出相匹配的子串中的第一个字符在主串S中出现的位置。若匹配失败, 阅读全文
posted @ 2019-04-08 23:28 叶坚持 阅读(4489) 评论(4) 推荐(1)
摘要:I - 小Z的袜子(hose) 作为一个生活散漫的人,小Z每天早上都要耗费很久从一堆五颜六色的袜子中找出一双来穿。终于有一天,小Z再也无法忍受这恼人的找袜子过程,于是他决定听天由命…… 具体来说,小Z把这N只袜子从1到N编号,然后从编号L到R(L 尽管小Z并不在意两只袜子是不是完整的一双,甚至不在意 阅读全文
posted @ 2019-04-08 22:13 叶坚持 阅读(207) 评论(1) 推荐(0)
摘要:A - D-query Given a sequence of n numbers a1, a2, ..., an and a number of d-queries. A d-query is a pair (i, j) (1 ≤ i ≤ j ≤ n). For each d-query (i, 阅读全文
posted @ 2019-04-08 00:05 叶坚持 阅读(306) 评论(0) 推荐(0)
摘要:解题思路:这道题的题意就是给你n,总距离X,速度v;以及n组数据:人行道的左端点和右端点,以及人行道的速度(竖直方向),如果从(0,0)到(X,0)的时间小于2X/v,则输出其时间,否则输出”Too hard“; 需要一定的推导和简单物理知识 代码如下: 阅读全文
posted @ 2019-04-07 00:35 叶坚持 阅读(308) 评论(0) 推荐(0)
摘要:D. Equalize Them All time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output You are given an ar 阅读全文
posted @ 2019-04-01 21:18 叶坚持 阅读(495) 评论(0) 推荐(0)
摘要:A. Diverse Strings time limit per test 1 second time limit per test memory limit per test 256 megabytes memory limit per test input standard input inp 阅读全文
posted @ 2019-04-01 00:28 叶坚持 阅读(546) 评论(0) 推荐(0)