题目链接:

A. Polycarp's Pockets

time limit per test

1 second

memory limit per test

256 megabytes

input

standard input

output

standard output

Polycarp has nn coins, the value of the ii-th coin is aiai. Polycarp wants to distribute all the coins between his pockets, but he cannot put two coins with the same value into the same pocket.

For example, if Polycarp has got six coins represented as an array a=[1,2,4,3,3,2]a=[1,2,4,3,3,2], he can distribute the coins into two pockets as follows: [1,2,3],[2,3,4][1,2,3],[2,3,4].

Polycarp wants to distribute all the coins with the minimum number of used pockets. Help him to do that.

Input

The first line of the input contains one integer nn (1≤n≤1001≤n≤100) — the number of coins.

The second line of the input contains nn integers a1,a2,…,ana1,a2,…,an (1≤ai≤1001≤ai≤100) — values of coins.

Output

Print only one integer — the minimum number of pockets Polycarp needs to distribute all the coins so no two coins with the same value are put into the same pocket.

Examples

input

Copy

6
1 2 4 3 3 2

output

Copy

2

input

Copy

1
100

output

Copy

1

代码实现:

#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<cctype>
#include<cmath>
#include<iostream>
#include<sstream>
#include<iterator>
#include<algorithm>
#include<string>
#include<vector>
#include<set>
#include<map>
#include<stack>
#include<deque>
#include<queue>
#include<list>
using namespace std;
const double eps = 1e-8;
typedef long long LL;
typedef unsigned long long ULL;
const int INF = 0x3f3f3f3f;
const int INT_M_INF = 0x7f7f7f7f;
const LL LL_INF = 0x3f3f3f3f3f3f3f3f;
const LL LL_M_INF = 0x7f7f7f7f7f7f7f7f;
const int dr[] = {0, 0, -1, 1, -1, -1, 1, 1};
const int dc[] = {-1, 1, 0, 0, -1, 1, -1, 1};
const int MOD = 1e9 + 7;
const double pi = acos(-1.0);
const int MAXN=5010;
const int MAXM=100010;
const int M=50010;
int main()
{int n;while(scanf("%d",&n)!=EOF){  int a[110],vis[150];memset(vis,0,sizeof(vis));for(int i=1;i<=n;i++){scanf("%d",&a[i]);vis[a[i]]++; }int maxx=-10;for(int i=1;i<150;i++)maxx=max(maxx,vis[i]);cout<<maxx<<endl;}return 0;
}

CodeForces - 1003A Polycarp's Pockets相关推荐

  1. codeforces 1003A. Polycarp's Pockets,C. Intense Heat(暴力)

    A. Polycarp's Pockets 题目链接:codeforces 1003A 题意:      给n个数,要求相同的数不能放在一个口袋,问最少需要多少个口袋 题解:     求出最多的相同数 ...

  2. codeforces 1003a Polycarp's Pockets

    http://www.elijahqi.win/archives/3910 求出现次数最多的数出现几次 #include<bits/stdc++.h> using namespace st ...

  3. codeforces 解题报告 1003A. Polycarp's Pockets 模拟

    http://codeforces.com/problemset/problem/1003/A 解题思路: 1.每个包里只能有不同面额的硬币,问要多少个包才能装完这堆硬币 2.弄n个桶,桶内是相同硬币 ...

  4. Codeforces #494 A. Polycarp's Pockets

    A. Polycarp's Pockets 废话不多说,直接上AC程序! #include<bits/stdc++.h> using namespace std; int n,x; int ...

  5. Codeforces 1005D Polycarp and Div 3

    Codeforces 1005D Polycarp and Div 3 dp[i]表示前i个数最多能分成多少块%3为0,nxt[x]表示x这个上一次出现的位置. 首先想到 $ dp[i] = max( ...

  6. 落谷CF1003A Polycarp's Pockets

    题目描述 Polycarp has n n n coins, the value of the i i i -th coin is ai a_i ai​ . Polycarp wants to dis ...

  7. CodeForces 858C Did you mean... 、 CodeForces 858D Polycarp's phone book!黑科技

    C. Did you mean... 题意:将一个字符串最少分成几个小的字符串,使得每个字符串都没有连续三个及以上的辅音字母,连续三个相同的辅音字母不算. 贪心构造即可,注意连续三个相同的辅音的时候将 ...

  8. Codeforces 861D - Polycarp's phone book 字典树/hash

    输入7e4个字符串,要求每个串提取一个子串来唯一表示 4s题可以hash暴力水过,大体思路就是把所有子串map自己的母串,过程中如果这个子串已有hash值就标-1 然后枚举map元素,维护最小化一下就 ...

  9. CodeForces - 858D Polycarp's phone book(字典树/map)

    题目链接:点击查看 题目大意:给出n个电话号码,每个电话号码都由9位数字组成,我们需要输出每个电话号码的最小关键词,最小关键词是指当输入这个关键词后,只能与当前的电话号码的其中一段匹配,而不能和其他电 ...

最新文章

  1. Charles是mac的iddler抓包工具
  2. Eclipse配置C++时的三个关键环境变量
  3. SpringMVC源码解析与思考
  4. 关于 jMeter 结果报表里的 APDEX (Application Performance Index)
  5. 登陆后保持环境变量导出
  6. javascript textContent与innerText的异同分析
  7. AI市场需求变化了,应届生们却还停留在几年前的认知上...
  8. 修改FCKEditor实现将图片、文件等保存到数据库
  9. Linux父进程如何发信号给子进程,关于C#:fork和signal:如何将信号从父进程发送到特定的子进程...
  10. 数据结构学习之矩阵乘法与矩阵的转置
  11. 项目管理手记(七)--DRP系统的文化输出与营销
  12. 服务器启动端口被占用,解决Nginx启动出现端口被占用的问题
  13. HardLink SymbolLink Junctions
  14. 爬虫3_获取汇率数据
  15. CPU-Z查看内存条信息
  16. 【Origin双y轴】三条曲线,其中两条曲线共用一个y轴
  17. javafx:AnchorPane设置子容器和父容器同等大小
  18. python 识图点击_Python图片识别——人工智能篇
  19. 新浪博客(sina blog)批量删除代码
  20. 利用SwitchyOmega和Jmeter实现Jmeter录制功能

热门文章

  1. plt.subplot 用法
  2. C语言的基本语句结构
  3. 西方文化系列讲座之希腊文化(上)
  4. python 计算置信区间_从样本数据计算置信区间
  5. 芯洲科技SCT53600理想二极管控制器与反向电流保护完全替代德州仪器LM74700
  6. echarts+ajax 入门教程
  7. 逻辑回归原理详解(附手写推导)
  8. C++中的左值和右值
  9. r语言 read_html,R语言外部数据读取(示例代码)
  10. JS 获取当日凌晨的时间戳