http://codeforces.com/contest/352/problem/A

 #include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std; int n;
int a[];
int main()
{
int t1=,t2=;
scanf("%d",&n);
for(int i=; i<=n; i++)
{
scanf("%d",&a[i]);
if(a[i]==) t1++;
else t2++;
}
if(t1==)
{
printf("-1\n");
}
else if(t2<)
{
printf("0\n");
}
else
{
for(int i=; i<=t2/; i++)
{
for(int j=; j<=; j++)
{
printf("");
}
}
for(int i=; i<=t1; i++) printf("");
printf("\n");
}
}

cf A. Jeff and Digits的更多相关文章

  1. A. Jeff and Digits(cf)

    A. Jeff and Digits time limit per test 1 second memory limit per test 256 megabytes input standard i ...

  2. CF352A Jeff and Digits

    Jeff's got n cards, each card contains either digit 0, or digit 5. Jeff can choose several cards and ...

  3. 『题解』Coderforces352A Jeff and Digits

    更好的阅读体验 Portal Portal1: Codeforces Portal2: Luogu Description Jeff's got n cards, each card contains ...

  4. codeforces A. Jeff and Digits 解题报告

    题目链接:http://codeforces.com/problemset/problem/352/A 题目意思:给定一个只有0或5组成的序列,你要重新编排这个序列(当然你可以不取尽这些数字),使得这 ...

  5. Codeforces Round #204 (Div. 2) A.Jeff and Digits

    因为数字只含有5或0,如果要被90整除的话必须含有0,否则输出-1 如果含有0的话,就只需考虑组合的数字之和是9的倍数,只需要看最大的5的个数能否被9整数 #include <iostream& ...

  6. [CF 351B]Jeff and Furik[归并排序求逆序数]

    题意: 两人游戏, J先走. 给出一个1~n的排列, J选择一对相邻数[题意!!~囧], 交换. F接着走, 扔一硬币, 若正面朝上, 随机选择一对降序排列的相邻数, 交换. 若反面朝上, 随机选择一 ...

  7. cf C. Jeff and Rounding

    http://codeforces.com/contest/352/problem/C 题意:给予N*2个数字,改变其中的N个向上进位,N个向下进位,使最后得到得数与原来数的差的绝对值最小 对每一个浮 ...

  8. cf B. Jeff and Periods

    http://codeforces.com/contest/352/problem/B #include <cstdio> #include <cstring> #includ ...

  9. CF 351A - Jeff and Rounding DP

    http://codeforces.com/problemset/problem/351/C 题意:有2*n个浮点数a1,a2,a3...a2*n,把他们分成n队,对于每对<A,B>,对A ...

随机推荐

  1. hdu Examining the Rooms

    这道题的知识点第一次听说 ,就是应用斯特林数.题目的意思是给你房间数N,和最多能破门的个数,让你求能全部把房间打开的概率! a[i][j]=a[i-1][j-1]+(i-1)*a[i-1][j]; # ...

  2. POJ 1225 Substrings

    http://poj.org/problem?id=1226 题意:给定n个串.求一个最长的串,使得这个串或者其反串在每个串中都出现过? 思路:先在大串里面加入正反串,然后二分,判定即可. #incl ...

  3. bat命令大全

    一.简单批处理内部命令简介 1.Echo 命令 打开回显或关闭请求回显功能,或显示消息.如果没有任何参数,echo 命令将显示当前回显设置.   语法 echo [{on│off}] [message ...

  4. PowerShell文件系统(一)前言

    PowerShell文件系统(一)前言 3 12 2月, 2014  在 Powershell tagged Powershell教程 / 别名 / 文件系统 by Mooser Lee PowerS ...

  5. 【转】使用 vim + ctags + cscope + taglist 阅读源码

    原文网址:http://my.oschina.net/u/554995/blog/59927 最近,准备跟学长一起往 linux kernel 的门里瞧瞧里面的世界,虽然我们知道门就在那,但我们还得找 ...

  6. ORTP库API使用入门

    一.简介 ORTP是一个支持RTP以及RFC3550协议的库,有如下的特性: (1)使用C语言编写,可以工作于windows, Linux, 以及 Unix平台 (2)实现了RFC3550协议,提供简 ...

  7. requireJS define require

    原文地址:http://blog.csdn.net/xiaogou56a/article/details/21340213 define 用来定义模块 require 用来加载模块 1 因为定义一个模 ...

  8. 选择Comparable接口还是Comparator

    个人理解: 如果我本身知道这个类的对象我要用来比较,那么就拿这个类实现Comparable接口(compareTo(Object o) 方法).如果我本身没有预料到我要比较这个类的对象,那么,我可以建 ...

  9. poj 2251 Dungeon Master(bfs)

    Description You are trapped in a 3D dungeon and need to find the quickest way out! The dungeon is co ...

  10. hdu4055 dp

    http://acm.hdu.edu.cn/showproblem.php?pid=4055 Problem Description The signature of a permutation is ...