有根树的表达 题目:Rooted Trees Aizu - ALDS1_7_A A graph G = (V, E) is a data structure where V is a finite set of vertices and E is a binary relation on V rep ...
分类:
其他好文 时间:
2019-06-07 21:00:50
阅读次数:
114
搜索的应用-计算最优解 题目: You are given nn packages of wiwi kg from a belt conveyor in order (i=0,1,...n?1i=0,1,...n?1). You should load all packages onto kk tr ...
分类:
其他好文 时间:
2019-06-07 19:25:09
阅读次数:
127
[TOC] 题目 传送门: "ITP2_8_A: Map: Search" 描述 对于存储由一对字符串键和整数值形成的元素的字典M, 执行下面给出的操作, 请注意, M中的每一个键必须是唯一的 $insert(key, x)$: 插入一个由键和值组成的元素到M中, 如果已经有元素包含了这个键, 替换 ...
分类:
其他好文 时间:
2019-06-05 17:52:01
阅读次数:
99
[TOC] 题目 传送门: "ALDS1_14_B: String Search" 描述 寻找字符串 P 在一个文本 T 中出现的位置, 输出所有在 T 中找到的 P 的索引, T 的索引从0开始. 输入 第一行, 给出一个文本 T , 在第二行, 给出一个字符串 P 输出 每行输出一个在 T 中找 ...
分类:
其他好文 时间:
2019-05-31 21:24:08
阅读次数:
132
Solution Analysis 很经典的8皇后问题, 题目中已给出了几个皇后的位置并且不允许更改这几个皇后的位置 要求的输出是8 8的棋盘 可以使用递归的思路来求解 Design 使用了1个int数组来存储每行皇后的位置 使用了3个bool数组来判断当前列, 主对角线, 副对角线是否有冲突 设计 ...
分类:
其他好文 时间:
2019-05-18 10:03:21
阅读次数:
103
Problem "Portal" Solution Analysis 要求在一个有序的序列中, 找出不小于k的下标位置, 也就是大于等于k的第一个数的位置 可以采用二分查找的思想, 不过循环结束的条件不再是找到跳出, 而是查找到某一个位置, 它本身大于等于k, 而它的紧邻前一位小于k, 或者它本身小 ...
分类:
其他好文 时间:
2019-05-17 13:36:49
阅读次数:
105
For a given sequence $A = \{a_0, a_1, ..., a_{n-1}\}$ which is sorted by ascending order, find a specific value $k$ given as a query. Input The input ...
分类:
其他好文 时间:
2018-12-01 15:33:09
阅读次数:
211
Longest Common Subsequence "Aizu ALDS1_10_C" For given two sequences X and Y, a sequence Z is a common subsequence of X and Y if Z is a subsequence of ...
分类:
其他好文 时间:
2018-12-01 11:12:55
阅读次数:
194
Source https://onlinejudge.u-aizu.ac.jp/problems/ALDS1_10_C Description Time Limit : 1 sec , Memory Limit : 131072 KB Time Limit : 1 sec , Memory Limi ...
分类:
其他好文 时间:
2018-11-02 21:43:17
阅读次数:
164
Source https://onlinejudge.u-aizu.ac.jp/courses/lesson/1/ALDS1/all/ALDS1_10_B Description Time Limit : 1 sec , Memory Limit : 131072 KB Time Limit : 1 ...
分类:
其他好文 时间:
2018-11-02 01:58:42
阅读次数:
144