题目链接

https://www.patest.cn/contests/gplt/L1-022

AC代码

#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <deque>
#include <vector>
#include <queue>
#include <string>
#include <cstring>
#include <map>
#include <stack>
#include <set>
#include <cstdlib>
#include <ctype.h>
#include <numeric>
#include <sstream>
using namespace std;

typedef long long LL;
const double PI = 3.14159265358979323846264338327;
const double E = 2.718281828459;
const double eps = 1e-6;
const int MAXN = 0x3f3f3f3f;
const int MINN = 0xc0c0c0c0;
const int maxn = 1e5 + 5;
const int MOD = 1e9 + 7;

int main()
{
    int n;
    cin >> n;
    int num;
    int a[2] = {0};
    for (int i = 0; i < n; i++)
    {
        scanf("%d", &num);
        if (num & 1)
            a[0]++;
        else
            a[1]++;
    }
    printf("%d %d\n", a[0], a[1]);
}

PAT 天梯赛 L1-022. 奇偶分家 【水】的更多相关文章

  1. PAT 天梯赛 L1-047. 装睡 【水】

    题目链接 https://www.patest.cn/contests/gplt/L1-047 AC代码 #include <iostream> #include <cstdio&g ...

  2. PAT 天梯赛 L1-042. 日期格式化 【水】

    题目链接 https://www.patest.cn/contests/gplt/L1-042 AC代码 #include <iostream> #include <cstdio&g ...

  3. PAT 天梯赛 L1-041. 寻找250 【水】

    题目链接 https://www.patest.cn/contests/gplt/L1-041 AC代码 #include <iostream> #include <cstdio&g ...

  4. PAT 天梯赛 L1-016. 查验身份证 【水】

    题目链接 https://www.patest.cn/contests/gplt/L1-016 AC代码 #include <iostream> #include <cstdio&g ...

  5. PAT 天梯赛 L1-014. 简单题 【水】

    题目链接 https://www.patest.cn/contests/gplt/L1-014 AC代码 #include <iostream> #include <cstdio&g ...

  6. PAT 天梯赛 L1-012. 计算指数 【水】

    题目链接 https://www.patest.cn/contests/gplt/L1-012 AC代码 #include <iostream> #include <cstdio&g ...

  7. PAT 天梯赛 L1-010. 比较大小 【水】

    题目链接 https://www.patest.cn/contests/gplt/L1-010 AC代码 #include <iostream> #include <cstdio&g ...

  8. PAT 天梯赛 L1-007. 念数字 【水】

    题目链接 https://www.patest.cn/contests/gplt/L1-007 AC代码 #include <iostream> #include <cstdio&g ...

  9. PAT 天梯赛 L1-004. 计算摄氏温度 【水】

    题目链接 https://www.patest.cn/contests/gplt/L1-004 AC代码 #include <iostream> #include <cstdio&g ...

  10. PAT 天梯赛 L1-028. 判断素数 【水】

    题目链接 https://www.patest.cn/contests/gplt/L1-028 AC代码 #include <iostream> #include <cstdio&g ...

随机推荐

  1. CRF++使用说明

    摘选自 :CRF++: Yet Another CRF toolkit Usage: 1.输入输出文件 He PRP B-NP reckons VBZ B-VP the DT B-NP current ...

  2. IE下使用location对象有时会出现“没有权限”的错误

    http://jadyyang.blog.sohu.com/145340845.html ——————————————————————————————————————————————————————— ...

  3. freemarker 超出字符用省略号表示

    <#if x.content?length lt 200> ${x.content} <#else> ${x.content[0..201]}... </#if>

  4. edmx

  5. python eval() hasattr() getattr() setattr() 函数使用方法详解

    eval() 函数 --- 将字符串str当成有效的表达式来求值并返回计算结果. 语法:eval(source[, globals[, locals]]) ---> value 参数: sour ...

  6. ChemDraw 15.1 Pro插入阿尔法可以这样做

    在理工科学科学习过程中,大家都会遇到各种希腊字母,而阿尔法(α)又是最常见的一个.最新版本ChemDraw 15.1 Pro的功能更加卓越,在很多功能上都进行了优化,操作更简便.其中,就可以很好的在公 ...

  7. 【BZOJ4631】踩气球 链表+线段树+堆

    [BZOJ4631]踩气球 Description 六一儿童节到了, SHUXK 被迫陪着M个熊孩子玩一个无聊的游戏:有N个盒子从左到右排成一排,第i个盒子里装着Ai个气球. SHUXK 要进行Q次操 ...

  8. IOS 预览pdf,word文档的集中方式

    在iPhone中可以很方便的预览文档文件,如:pdf.word等等,这篇文章将以PDF为例.介绍三种预览PDF的方式,又分别从本地pdf文档和网络上的pdf文档进行对比. 预览本地PDF文档: 1.使 ...

  9. 170214、mybatis一级和二级缓存

    mybatis一级缓存是指在内存中开辟一块区域,用来保存用户对数据库的操作信息(sql)和数据库返回的数据,如果下一次用户再执行相同的请求, 那么直接从内存中读数数据而不是从数据库读取. 其中数据的生 ...

  10. 【JDF】学习和理解

    一.资源地址 官方GitBub地址: putaoshu/jdf: Jingdong front-end integrated solution https://github.com/putaoshu/ ...