A. Is your horseshoe on the other hoof?
点击打开题目
time limit per test

2 seconds

memory limit per test

256 megabytes

input

standard input

output

standard output

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.

Input

The first line contains four space-separated integers s1, s2, s3, s4 (1 ≤ s1, s2, s3, s4 ≤ 109) — the colors of horseshoes Valera has.

Consider all possible colors indexed with integers.

Output

Print a single integer — the minimum number of horseshoes Valera needs to buy.

Sample test(s)
Input
1 7 3 3

Output
1

Input
7 7 7 7

Output
3
。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。
#include <iostream>
#include<stdlib.h>
using namespace std;
int check(int a[])
{int i,k=0;for(i=0; i<3; i++){if(a[i]!=a[i+1])k++;}return 4-k-1;
}
int cmp(const void *a,const void *b)
{return *(int *)a-*(int *)b;
}
int main()
{int a[4],i;while(cin>>a[0]){for(i=1; i<4; i++){cin>>a[i];}qsort(a,4,sizeof(a[0]),cmp);cout<<check(a)<<endl;}return 0;
}

codeforces228A Is your horseshoe on the other hoof?(水题)相关推荐

  1. Wand mixture在Horseshoe模型中的应用

    Wand mixture在Horseshoe模型中的应用 Wand et al (2011) Mixture Horseshoe模型的算法 Wand et al (2011) Mixture X∼C+ ...

  2. Horseshoe prior的R package介绍:HS.normal.mean函数

    Horseshoe prior的R package介绍:HS.normal.mean函数 最近做的一些事情需要和Horseshoe prior对比,所以一直在看Horseshoe的一些资料.上周做了一 ...

  3. aMCMC for Horseshoe: algorithms

    aMCMC for Horseshoe: algorithms Exact Algorithm Step 1: sampling η\etaη Step 2: sampling ξ\xiξ Step ...

  4. HOOF(Histogram of Oriented Optical Flow)特征

    看微表情识别的相关论文,总会提到各种手工特征,HOOF就是其中一种.HOOF特征全称Histogram of Oriented Optical Flow,出自09年的一篇论文Histograms of ...

  5. P3609 [USACO17JAN] Hoof, Paper, Scissor G

    题目背景 本题与 银组同名题目 在题意上一致,唯一的差别在于对变手势次数的限制. 题目描述 你可能玩过"石头,剪刀,布",这个游戏在奶牛中同样流行,不过它的名字变成了"蹄 ...

  6. 洛谷 P3069 Hoof, Paper, Scissor G

    原题链接 首先,这道题用记搜就行,甚至都不用STL. 先把数组(我说过不用STL)写上 long long memory[4][21][100001] = {0}; 第二,我们要有一个可以判断输赢的函 ...

  7. 终极单词index 排序 G-H

    终极英语单词12000 1 变身口语达人3000词 1-3000 终极英语单词12000 2 成为英语学霸3000词 3001-6000 终极英语单词12000 3 畅读英文报刊3000词 6001- ...

  8. 《数据科学家养成手册》第十章--混沌论

    <For the want of nail> For the want of a nail, the shoe was lost;for want of a shoe, the horse ...

  9. 谷歌用1.2万个模型“推翻”现有无监督研究成果!斩获ICML 2019最佳论文

    作者 | 夕颜.Just 出品 | AI科技大本营(ID:rgznai100) 6 月 11 日,在美国加州长滩举行的 ICML 公布了 2019 年最佳论文奖,来自苏黎世联邦理工大学.谷歌大脑等的团 ...

  10. 统计学权威盘点过去50年最重要的统计学思想,因果推理、bootstrap等上榜,Judea Pearl点赞...

    作者 | 陈彩娴.Mr Bear 编辑 | 青暮 本文转自AI科技评论 近日,图灵奖得主."贝叶斯网络之父"Judea Pearl在Twitter上分享了一篇新论文"Wh ...

最新文章

  1. 设置cl.exe环境变量
  2. Java Scanner类
  3. 流水线可靠数据传输协议
  4. 【目标检测】cvpr2021_VarifocalNet: An IoU-Aware Dense Object Detector
  5. Python入门学习指南--内附学习框架
  6. 7-92 稳赢 (15 分)
  7. 新上手jupyterlab安装及问题解决
  8. Reflector7.5.2.1的Bug
  9. SYN-COOKIE
  10. 科技爱好者周刊(第 148 期):微增长时代
  11. Spring java excel_SpringBoot之导入导出Excel(Java8实现)
  12. word表格中多行只有一行字,让一行字居中的设置操作
  13. 使用UltraISO制作U盘系统启动盘图文教程
  14. 保险公司电子印章集中管理解决方案
  15. 第六章 利用深度Q学习来实现最优控制的智能体
  16. 第一周-机器学习监督学习-无监督学习
  17. MATLAB中求传递函数代码
  18. React Native系列——WebView组件使用介绍
  19. 海信IP202H盒子破解方法
  20. Pycharm添加默认头注释方法

热门文章

  1. 卷积神经网络交通标志识别
  2. 量子计算机物理学,使用量子计算机来测试物理学的基本原理
  3. python炫酷烟花表白源代码-python炫酷烟花表白的源代码分享
  4. 三维提取等值面的重建方法Marching Cubes
  5. python3  类中方法的调用
  6. 计算机表格折线图添加图例,怎么用EXCEL表格数据做折线图-如何用excel做折线图添加系列...
  7. 姓周取名:周姓漂亮有涵养的女孩名字
  8. python运用ico图标,处理Django中的favicon.ico图标实例方法
  9. 【BZOJ2813】奇妙的Fibonacci(结论,线性筛)
  10. Python穷举法破解密码