A. Drazil and Date

无算法,判断(s - (a + b)) % 2是否为零,若零,表示在s步内还能走向其他的地方并且回来
否则,都是No

#include <cstdio>
#include <iostream>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <string>
#include <map>
#include <vector>
#include <set>
using namespace std; const int MAXN = 1e6 + 10;
const int INF = 0x3f3f3f3f; int main(void)
{
//freopen ("A.in", "r", stdin); long long a, b, s; while (~scanf ("%I64d%I64d%I64d", &a, &b, &s))
{
if (a < 0) a = -a;
if (b < 0) b = -b;
if (a + b <= s)
{
int x = s - (a + b);
if (x % 2 == 0) puts ("Yes");
else puts ("No");
}
else puts ("No");
} return 0;
}

B. Drazil and His Happy Friends

无算法,标记和更新happy的人就行了
少写一个&!,导致runtime error

#include <cstdio>
#include <iostream>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <string>
#include <map>
#include <vector>
#include <set>
using namespace std; const int MAXN = 1e6 + 10;
const int INF = 0x3f3f3f3f;
int a[110], b[110]; int main(void)
{
//freopen ("B.in", "r", stdin); int n, m;
scanf ("%d%d", &n, &m); memset (a, 0, sizeof (a));
memset (b, 0, sizeof (b)); int x, y, tmp, cnt = 0;
scanf ("%d", &x);
for (int i=0; i<x; ++i)
{
scanf ("%d", &tmp);
a[tmp] = 1;
cnt++;
}
scanf ("%d", &y);
for (int i=0; i<y; ++i)
{
scanf ("%d", &tmp);
b[tmp] = 1;
cnt++;
} for (int i=0; i<=m*n*2; ++i)
{
if (a[i%n] || b[i%m])
{
if (!a[i%n]) cnt++;
if (!b[i%m]) cnt++;
a[i%n] = b[i%m] = 1;
}
}
(cnt == n + m) ? puts ("Yes") : puts ("No"); return 0;
}

C. Drazil and Factorial

无算法,数学问题貌似就是对单个数字分解质因数,替换,然后sort排序就行了

#include <cstdio>
#include <iostream>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <string>
#include <map>
#include <vector>
#include <set>
using namespace std; const int MAXN = 1e6 + 10;
const int INF = 0x3f3f3f3f; string res[10] = {"", "", "2", "3", "322", "5", "53", "7", "7222", "7332"}; int main(void)
{
//freopen ("C.in", "r", stdin); int n;
while (cin >> n)
{
string s, ans;
cin >> s;
for (int i=0; i<s.size(); ++i)
{
ans += res[s[i] - '0'];
}
sort (ans.begin (), ans.end ());
reverse (ans.begin (), ans.end ()); cout << ans << endl;
} return 0;
}

Codeforces Round #292 (Div. 2)的更多相关文章

  1. Codeforces Round #292 (Div. 2) C. Drazil and Factorial

    题目链接:http://codeforces.com/contest/515/problem/C 给出一个公式例如:F(135) = 1! * 3! * 5!; 现在给你一个有n位的数字a,让你求这样 ...

  2. Codeforces Round #292 (Div. 1) C. Drazil and Park 线段树

    C. Drazil and Park 题目连接: http://codeforces.com/contest/516/problem/C Description Drazil is a monkey. ...

  3. Codeforces Round #292 (Div. 1) B. Drazil and Tiles 拓扑排序

    B. Drazil and Tiles 题目连接: http://codeforces.com/contest/516/problem/B Description Drazil created a f ...

  4. Codeforces Round #292 (Div. 1) B. Drazil and Tiles (类似拓扑)

    题目链接:http://codeforces.com/problemset/problem/516/B 一个n*m的方格,'*'不能填.给你很多个1*2的尖括号,问你是否能用唯一填法填满方格. 类似t ...

  5. Codeforces Round #292 (Div. 1)A. Drazil and Factorial 构造

    A. Drazil and Factorial 题目连接: http://codeforces.com/contest/516/problem/A Description Drazil is play ...

  6. Codeforces Round #292 (Div. 1) - B. Drazil and Tiles

    B. Drazil and Tiles   Drazil created a following problem about putting 1 × 2 tiles into an n × m gri ...

  7. codeforces 516c// Drazil and Park// Codeforces Round #292(Div. 1)

    题意:一个圆环上有树,猴子上下其中一棵树,再沿着换跑,再上下另一棵树.给出一个区间,问最大的运动距离是. 给出区间大小dst,和数高数组arr. 设区间[x,y],a[x]=2*arr[x]+dst[ ...

  8. Codeforces Round #292 (Div. 1) C - Drazil and Park

    C - Drazil and Park 每个点有两个值Li 和 Bi,求Li + Rj (i < j) 的最大值,这个可以用线段树巧妙的维护.. #include<bits/stdc++. ...

  9. Codeforces Round #292 (Div. 2) D. Drazil and Tiles [拓扑排序 dfs]

    传送门 D. Drazil and Tiles time limit per test 2 seconds memory limit per test 256 megabytes Drazil cre ...

随机推荐

  1. 数据库的设计(E-R图,数据库模型图,三大范式)

    一.数据库设计的概念 数据库设计是将数据库中的数据实体及这些数据实体之间的关系,进行规划和结构化的过程. 二.数据库设计的重要性 如果一个数据库没有进行一个良好的设计,那么这个数据库完成之后他的缺点是 ...

  2. CUDA中的Toolkit

    CUDA Toolkit是什么? 对于使用 C 语言和 C++ 来开发 GPU 加速应用程序的开发者来说,NVIDIA CUDA Toolkit 可提供一个综合的开发环境.CUDA Toolkit 包 ...

  3. c3p0数据库连接池

    C3P0: 一个开源的JDBC连接池,它实现了数据源和JNDI绑定,支持JDBC3规范和JDBC2的标准扩展.目前使用它的开源项目有Hibernate,Spring等. 默认情况下(即没有配置连接池的 ...

  4. #!/bin/bash

    #!/bin/bash是指此脚本使用/bin/bash来解释执行. 其中,#!是一个特殊的表示符,其后,跟着解释此脚本的shell路径. bash只是shell的一种,还有很多其它shell,如:sh ...

  5. Selenium webdriver 学习总结-元素定位

    Selenium webdriver 学习总结-元素定位 webdriver提供了丰富的API,有多种定位策略:id,name,css选择器,xpath等,其中css选择器定位元素效率相比xpath要 ...

  6. mysql cluster 运行的必备条件

    1.由于同步复制一共需要4次消息传递,故mysql  cluster的数据更新速度比单机mysql要慢.所以mysql cluster要求运行在千兆以上的局域网内,节点可以采用双网卡,节点组之间采用直 ...

  7. 【JAVA、C++】LeetCode 019 Remove Nth Node From End of List

    Given a linked list, remove the nth node from the end of list and return its head. For example, Give ...

  8. svn插件subclipse使用http代理同步svn时出现异常(解决)

    现象描述: 对项目进行“与资源库进行同步”时弹出对话框显示以下错误信息: 同步 SVNStatusSubscriber 时报告了错误.1 中的 0 个资源已经同步. 同步 /MMonitorLogis ...

  9. static_cast, dynamic_cast, const_cast

    http://www.cnblogs.com/chio/archive/2007/07/18/822389.html 首先回顾一下C++类型转换: C++类型转换分为:隐式类型转换和显式类型转换 第1 ...

  10. RGB888->RGB565->RGB888

     转自CB的博客:http://blog.chinaaet.com/detail/28298 在我们的计算机中,图像是以RGB888显示的,24位图每个像素保存了32bit的数据,即RGB888+Al ...