随笔分类 - STL
摘要:题目描述 如题,给出一个有向图,请输出从某一点出发到所有点的最短路径长度。 输入输出格式 输入格式: 第一行包含三个整数N、M、S,分别表示点的个数、有向边的个数、出发点的编号。 接下来M行每行包含三个整数Fi、Gi、Wi,分别表示第i条有向边的出发点、目标点和长度。 输出格式: 一行,包含N个用空
阅读全文
摘要:题目链接:http://abc043.contest.atcoder.jp/tasks/abc043_b Time limit : 2sec / Memory limit : 256MB Score : 200 points Problem Statement Sig has built his o
阅读全文
摘要:题目链接:http://abc042.contest.atcoder.jp/tasks/abc042_b Time limit : 2sec / Memory limit : 256MB Score : 200 points Problem Statement Iroha has a sequenc
阅读全文
摘要:给定一个升序排列的数组,去掉重复的数,并输出新的数组的长度。 例如:数组 A = \{1, 1, 2\}A={1,1,2},你的程序应该输出 22 即新数组的长度,新数组为 \{1, 2\}{1,2}。 要求:不能新开数组分配额外的空间,即常数空间限制。 输入格式 输入一个整数 n(1 \leq n
阅读全文
摘要:Jessica's a very lovely girl wooed by lots of boys. Recently she has a problem. The final exam is coming, yet she has spent little time on it. If she
阅读全文
摘要:Farmer John wants to repair a small length of the fence around the pasture. He measures the fence and finds that he needs N (1 ≤ N ≤ 20,000) planks of
阅读全文
摘要:Watchmen are in a danger and Doctor Manhattan together with his friend Daniel Dreiberg should warn them as soon as possible. There are n watchmen on a
阅读全文
摘要:湫湫减肥 越减越肥! 最近,减肥失败的湫湫为发泄心中郁闷,在玩一个消灭免子的游戏。 游戏规则很简单,用箭杀死免子即可。 箭是一种消耗品,已知有M种不同类型的箭可以选择,并且每种箭都会对兔子造成伤害,对应的伤害值分别为Di(1 <= i <= M),每种箭需要一定的QQ币购买。 假设每种箭只能使用一次
阅读全文