CF228A.Is your horseshoe on the other hoof?
入门
通过率:0%
时间限制:2.00s
内存限制:256MB
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
Valera the Horse is going to the party with friends. He has been following the fashion trends for a while, and he knows that it is very popular to wear all horseshoes of different color. Valera has got four horseshoes left from the last year, but maybe some of them have the same color. In this case he needs to go to the store and buy some few more horseshoes, not to lose face in front of his stylish comrades.
Fortunately, the store sells horseshoes of all colors under the sun and Valera has enough money to buy any four of them. However, in order to save the money, he would like to spend as little money as possible, so you need to help Valera and determine what is the minimum number of horseshoes he needs to buy to wear four horseshoes of different colors to a party.
瓦莱拉这匹马要和朋友们一起去参加聚会。他一直关注时尚潮流,知道如今流行穿四只颜色各不相同的马蹄铁。瓦莱拉去年还剩下四只马蹄铁,但其中可能有些颜色相同。在这种情况下,他需要去商店再买几只马蹄铁,以免在自己那些时髦的伙伴面前丢脸。
幸运的是,这家商店出售各种颜色的马蹄铁,而且瓦莱拉手头的钱足够买任意四只。然而,为了省钱,他希望花最少的钱,因此你需要帮助瓦莱拉确定:他至少需要购买多少只马蹄铁,才能在聚会上穿上四只颜色互不相同的马蹄铁?
输入格式
The first line contains four space-separated integers _s_1, _s_2, _s_3, _s_4 (1 ≤ _s_1, _s_2, _s_3, _s_4 ≤ 109) — the colors of horseshoes Valera has.
Consider all possible colors indexed with integers.
第一行包含四个以空格分隔的整数 s1, s2, s3, s4(1≤s1, s2, s3, s4≤109)——表示瓦莱拉所拥有的马蹄铁的颜色。
考虑所有可能的颜色,这些颜色用整数进行编号。
输出格式
Print a single integer — the minimum number of horseshoes Valera needs to buy.
输出一个整数——Valera 需要购买的马蹄铁的最少数量。
输入输出样例
输入#1
1 7 3 3
输出#1
1
输入#2
7 7 7 7
输出#2
3
输入解题思路,AI测评打分。不知道怎么写?