【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. echarts 总结:

    options配置项: title: 图表标题的配置 tooltip: 鼠标悬浮的提示 toolbox: 工具栏 series: 数据项,是每一个个的数据对象,可以根据type配置每一项数据的图例. ...

  2. 09-breack语句

  3. C# 字符串 分割 反转 Base64

    "; //字符串 ToBase64 byte[] bytes = Encoding.Default.GetBytes(pwd); pwd = Convert.ToBase64String(b ...

  4. [React] Make Controlled React Components with Control Props

    Sometimes users of your component want to have more control over what the internal state is. In this ...

  5. oracle之dbms_output

    oracle的dbms_output oracle的dbms_output的两个小问题 .如果dbms_output.put_line的内容不能显示,需要在命令行中先敲入set serveroutpu ...

  6. 使用Excel VBA(快捷键)(加菜单)

    将excel宏安全性调到中: 按alt+f11进入vba编辑器: 记住以下快捷键: F7 代码窗口 F4 属性窗口 ctrl+R 工程资源窗口 F5 程序运行 TAb 代码缩进 SHIFT+TAB  ...

  7. 学习《TensorFlow实战Google深度学习框架 (第2版) 》中文PDF和代码

    TensorFlow是谷歌2015年开源的主流深度学习框架,目前已得到广泛应用.<TensorFlow:实战Google深度学习框架(第2版)>为TensorFlow入门参考书,帮助快速. ...

  8. 安装php-ldap模块

    php-ldap模块作用就是实现ldap认证,因此需要安装 1.安装软件包解决依赖 yum install openldapyum install openldap-devel 2.拷贝库文件 cp ...

  9. Linux中配置网桥

    使用kvm虚拟机时,有时候需要自己添加网桥供guest使用. 不使用libvirt来管理的话,可以使用以下方法创建网桥并绑定到物理网卡(RHEL6/Fedora已实验): 1.创建网桥配置文件ifcf ...

  10. Template template parameter(模板參数) example

    /********************************************************************************* Copyright (C), 19 ...