SRM 670 div2 A BearSong
来源:互联网 发布:淘宝上新开店铺可信吗 编辑:程序博客网 时间:2024/05/21 11:22
Problem Statement for BearSong
Problem Statement
Bear Limak has recently learned about musical notes. He then listened to a song and noticed that some notes appeared less often than others. In fact, some notes were so rare that they appeared in the song only once!
Limak now wants to look for such notes in other songs. Write a program that will look for the rare notes.
You are given a int[] notes that describes a song. Each number in notes represents one note of the song. Different numbers represent different notes, equal numbers represent equal notes.
Compute and return the number of notes that occur exactly once in the given song.
Definition
Class:BearSongMethod:countRareNotesParameters:int[]Returns:intMethod signature:int countRareNotes(int[] notes)(be sure your method is public)Constraints
-notes will contain between 1 and 50 elements, inclusive.-Each element in notes will be between 1 and 1000, inclusive.Examples
0){9,10,7,8,9}
Returns: 3The rare notes are the notes 7, 8, and 10. Each of these notes occurs exactly once in the whole song. The note 9 occurs twice, so it is not a rare note1)
{8,8,7,6,7,3,5,10,9,3}
Returns: 4Each of the notes 5, 6, 9, and 10 occurs exactly once in this song.2)
{234,462,715,596,906}
Returns: 53)
{17}
Returns: 1
4)
{1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000}
Returns: 0
This problem statement is the exclusive and proprietary property of TopCoder, Inc. Any unauthorized use or reproduction of this information without the prior written consent of TopCoder, Inc. is strictly prohibited. (c)2010, TopCoder, Inc. All rights reserved.
This problem was used for:Single Round Match 673 Round 1 - Division II, Level One
题意:给你一个序列,求只出现一次的数的种数
很久没打TC了,忘记要加头文件,一直编译错误...............
- SRM 670 div2 A BearSong
- SRM 670 div2 A
- SRM 633 DIV2 A
- Topcoder SRM 636 Div2 A
- TopCoder SRM 637 Div2 A
- SRM 670 div2 B BearSlowlySorts
- TC SRM 670 Div2 1050 Treestrat
- SRM 114 DIV2 [550]
- SRM 398 DIV2 [250]
- SRM 399 DIV2 [250]
- SRM 387 DIV2 [250]
- SRM 387 DIV2 [600]
- SRM 397 DIV2 [500]
- SRM 400 DIV2 [250]
- SRM 400 DIV2 [500]
- SRM 397 DIV2 [1000]
- SRM 405 DIV2
- SRM 421Div2 500
- (android:windowIsTranslucent)影响(android:windowAnimationStyle)Activity切换动画无效
- cocos2dx3.1-3.2 action MoveBy源码分析
- 关于字符串读入
- 第23篇 js快速学习知识
- view viewGroup
- SRM 670 div2 A BearSong
- grep命令---Linux学习笔记
- headroom.js 用例,漂亮完善的 鼠标滚动 --->导航栏隐藏显示效果
- Python机器学习2-股票信息简单抓取
- github.com 加速方法
- C++ algorithm partition
- 使用Mac开发cocos2dx Android游戏
- PHP+ajaxfileupload 实现用户头像上传
- 没有躲过的坑--获取设备环境HDC