【Link】:

【Description】

【Solution】



每读入一个x;

把a[(x-1)/2]置为1即可;

统计1的个数



【NumberOf WA】

【Reviw】

【Code】

/*

*/
#include <bits/stdc++.h>
#define int long long
using namespace std;
int n;
int a[100000+100]; main(){
scanf("%lld",&n);
for (int i = 1;i <= n;i++){
int x;
scanf("%lld",&x);
a[(x-1)/2]++;
}
int cnt = 0;
for (int i = 0;i <= (int) 1e5;i++)
if (a[i])
cnt++;
printf("%lld\n",cnt);
return 0;
}

【CS Round #39 (Div. 2 only) A】Removed Pages的更多相关文章

  1. 【CS Round #39 (Div. 2 only) D】Seven-segment Display

    [Link]:https://csacademy.com/contest/round-39/task/seven-segment-display/ [Description] 0..9各自有一个数字, ...

  2. 【CS Round #39 (Div. 2 only) C】Reconstruct Sum

    [Link]:https://csacademy.com/contest/round-39/task/reconstruct-sum/ [Description] 给你一个数字S; 让你找有多少对A, ...

  3. 【CS Round #39 (Div. 2 only) B】Circle Elimination

    [Link]:https://csacademy.com/contest/round-39/task/circle-elimination/ [Description] [Solution] 把n个点 ...

  4. 【CS Round #36 (Div. 2 only) A】Bicycle Rental

    [题目链接]:https://csacademy.com/contest/round-36/task/bicycle-rental/ [题意] 让你从n辆车中选一辆车; 每一辆车有3个属性 1.到达车 ...

  5. 【CS Round #37 (Div. 2 only) D】Reconstruct Graph

    [Link]:https://csacademy.com/contest/round-37/task/reconstruct-graph/statement/ [Description] 给你一张图; ...

  6. 【CS Round #37 (Div. 2 only) B】Group Split

    [Link]:https://csacademy.com/contest/round-37/task/group-split/ [Description] 让你把一个数分成两个数a.b的和; (a,b ...

  7. 【CS Round #37 (Div. 2 only) A】Boring Number

    [Link]:https://csacademy.com/contest/round-37/task/boring-number/ [Description] 让你找离平均数最近的一个数的下标; [S ...

  8. 【CS Round #46 (Div. 1.5) E】Ultimate Orbs

    [链接]链接 [题意] n个人从左到右站在一条直线上.每个人都有一个能力值g[i],然后每个人可以将相邻的一个人打败. 然后它的能力值能够增加相应的能力值(就是打败了的那个人的能力值). A能够打败B ...

  9. 【CS Round #46 (Div. 1.5) C】Set Subtraction

    [链接]h在这里写链接 [题意] 一开始有n个数字,然后有一个数字X,把每个数字都减去X,又生成N个新的数字. 然后把这2*N个数字混在一起. 告诉你这2*N个数字是什么.让你复原出原来的N个数字,以 ...

随机推荐

  1. maven+spring-data-jpa环境搭建

    转自http://www.cnblogs.com/007sx/p/5658194.html 首先看一下项目结构: 所用到的jar(pom.xml): <project xmlns="h ...

  2. [Code+#4]最短路 (最短路)

    [Code+#4]最短路 题目背景 在北纬 91° ,有一个神奇的国度,叫做企鹅国.这里的企鹅也有自己发达的文明,称为企鹅文明.因为企鹅只有黑白两种颜色,所以他们的数学也是以二进制为基础发展的. 比如 ...

  3. Unity C# 设计模式(七)适配器模式

    定义: 将一个类的接口转换成客户希望的另一个接口.adapter模式使得原本由于接口不兼容而不能在一起的那些类可以一起工作. 示例代码: 1.类适配器 /* Class Adapter:类适配器,这里 ...

  4. IDEA使用GIT 上传到GitHub

    1.下载Git https://www.git-scm.com/download/ 2.安装 3.IDEA配置Git(设置Git路径,点击Test),如下代表成功 4.创建仓库 5.add 6.pus ...

  5. apache kafka监控系列-KafkaOffsetMonitor

    apache kafka中国社区QQ群:162272557 概览 近期kafka server消息服务上线了,基于jmx指标參数也写到zabbix中了.但总认为缺少点什么东西.可视化可操作的界面. z ...

  6. Python数据可视化——散点图

    PS: 翻了翻草稿箱. 发现竟然存了一篇去年2月的文章...尽管naive.还是发出来吧... 本文记录了python中的数据可视化--散点图scatter, 令x作为数据(50个点,每一个30维), ...

  7. [BZOJ4026]dC Loves Number Theory 欧拉函数+线段树

    链接 题意:给定长度为 \(n\) 的序列 A,每次求区间 \([l,r]\) 的乘积的欧拉函数 题解 考虑离线怎么搞,将询问按右端点排序,然后按顺序扫这个序列 对于每个 \(A_i\) ,枚举它的质 ...

  8. [ Linux ] 釋放記憶體指令(cache) - 轉載

    1. [Linux]釋放記憶體指令(cache) http://jeffreyy.pixnet.net/blog/post/84333764-%E3%80%90linux%E3%80%91%E9%87 ...

  9. HTTP 协议基础及发展历史

    一. 5层网络模型介绍 低三层 物理层:主要作用是定义物理设备如何传输数据. 数据链路层:在通信的实体间建立数据链路连接. 网路层:为数据在结点之间传输创建逻辑链路. 传输层: 想用户提供可靠的端到端 ...

  10. 远程带参数POST访问接口,返回数据

    1. string token = GetRequest.GetString("token"); int customer_id = GetRequest.GetInt(" ...