牛骨文教育服务平台(让学习变的简单)
博文笔记

OJ平台中的一个数组初始化问题

创建时间:2016-09-06 投稿人: 浏览次数:134

首先从一道ACM简单题说起:

问题 B: Friendship of Mouse

时间限制: 1 Sec  内存限制: 64 MB
提交: 24  解决: 15
[提交][状态][讨论版]

题目描述

Today in KBW, N mice from different cities are standing in a line. Each city is represented by a lowercase letter. The distance between adjacent mice (e.g. the 1st and the 2nd mouse, the N−1th and the Nth mouse, etc) are exactly 1. Two mice are friends if they come from the same city.

The closest friends are a pair of friends with the minimum distance. Help us find that distance.

声明:该文观点仅代表作者本人,牛骨文系教育信息发布平台,牛骨文仅提供信息存储空间服务。