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. RPM软件包管理的查询功能

    以后大家升级rpm包的时候,不要用Uvh了! 我推荐用Fvh 前者会把没有安装过得包也给装上,后者只会更新已经安装的包   总结:未安装的加上小写p,已安装的不需要加p   查询q    rpm {- ...

  2. qcow2文件压缩

    qemu-img convert -O qcow2 /path/old.img.qcow2 /path/new.img.qcow2 转自:https://havee.me/linux/2011-09/ ...

  3. 【Hadoop】Hive HSQ 使用 && 自定义HQL函数

    4 HQL 4.1 官网 4.1.1 https://cwiki.apache.org/confluence/display/Hive/LanguageManual 4.1.2 性能调优 4.1.2. ...

  4. jQuery Ajax 操作函数

    jQuery Ajax 操作函数 jQuery 库拥有完整的 Ajax 兼容套件.其中的函数和方法允许我们在不刷新浏览器的情况下从服务器加载数据. 函数 描述 jQuery.ajax() 执行异步 H ...

  5. Maximum Gap

    Given an unsorted array, find the maximum difference between the successive elements in its sorted f ...

  6. eclipse连接虚拟机

    1.启动eclipse 2.打开 "Help/Install New Software..." 3.打开Add…… 4.输入Name: Genymobile          Lo ...

  7. 第一章 用记事本搭建C#程序

    1.新建记事本:using System;class Text{ Console.WriteLine("你好如鹏网"); Console.WriteLine("www.r ...

  8. KMP模式匹配_2

    http://blog.csdn.net/lin_bei/article/details/1252686 三. 怎么求串的模式值next[n] 定义: (1)next[0]= -1 意义:任何串的第一 ...

  9. hp unix_ssh

    http://www.cyberciti.biz/faq/howto-hpux-sshd-service-startup-shutdown/ http://searchnetworking.techt ...

  10. Android主题换肤实现

    本系列文章主要是对一个Material Design的APP的深度解析,主要包括以下内容 基于Material Design Support Library作为项目整体框架.对应博文:Android ...