超级大水题;

只要用到一个小学用过的结论就可;能被9整除的数它的各位数相加能被9整除:

代码:

 #include<iostream>
#define maxn 1005
using namespace std;
int n,c0,c5,x;
int main()
{
cin>>n;
while(n--)
{
cin>>x;
if(x==)c0++;
else c5++;
}
if(c0==){cout<<"-1";return ;}
c5=c5-c5%;
if(c5==)cout<<"";
else
{
while(c5--)cout<<"";
while(c0--)cout<<"";
}
return ;
}

Codeforces Round #204 (Div. 2): A的更多相关文章

  1. CF&&CC百套计划3 Codeforces Round #204 (Div. 1) A. Jeff and Rounding

    http://codeforces.com/problemset/problem/351/A 题意: 2*n个数,选n个数上取整,n个数下取整 最小化 abs(取整之后数的和-原来数的和) 先使所有的 ...

  2. Codeforces Round #204 (Div. 2)->C. Jeff and Rounding

    C. Jeff and Rounding time limit per test 1 second memory limit per test 256 megabytes input standard ...

  3. CF&&CC百套计划3 Codeforces Round #204 (Div. 1) E. Jeff and Permutation

    http://codeforces.com/contest/351/problem/E 题意: 给出一些数,可以改变任意数的正负,使序列的逆序对数量最少 因为可以任意加负号,所以可以先把所有数看作正数 ...

  4. CF&&CC百套计划3 Codeforces Round #204 (Div. 1) B. Jeff and Furik

    http://codeforces.com/contest/351/problem/B 题意: 给出一个n的排列 第一个人任选两个相邻数交换位置 第二个人有一半的概率交换相邻的第一个数>第二个数 ...

  5. CF&&CC百套计划3 Codeforces Round #204 (Div. 1) D. Jeff and Removing Periods

    http://codeforces.com/problemset/problem/351/D 题意: n个数的一个序列,m个操作 给出操作区间[l,r], 首先可以删除下标为等差数列且数值相等的一些数 ...

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

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

  7. Codeforces Round #204 (Div. 2)->D. Jeff and Furik

    D. Jeff and Furik time limit per test 1 second memory limit per test 256 megabytes input standard in ...

  8. Codeforces Round #204 (Div. 2)->B. Jeff and Periods

    B. Jeff and Periods time limit per test 1 second memory limit per test 256 megabytes input standard ...

  9. Codeforces Round #204 (Div. 2) C

    写了一记忆化 TLE了  把double换成long long就过了 double 这么耗时间啊 #include <iostream> #include<cstdio> #i ...

  10. Codeforces Round #204 (Div. 2): B

    很简单的一个题: 只需要将他们排一下序,然后判断一下就可以了! 代码: #include<cstdio> #include<algorithm> #define maxn 10 ...

随机推荐

  1. android 判断应用程序是否已安装

    1.判断是否安装/** check the app is installed*/private boolean isAppInstalled(Context context,String packag ...

  2. MYSQL 5.7 MTS 复制

    http://www.linuxidc.com/Linux/2013-04/82712p2.htm http://keithlan.github.io/2016/06/28/MTS/ http://d ...

  3. RedHat7配置IdM server

    IdM服务器是一个集成身份验证服务器. Figure 1.1. The IdM Server: Unifying Services Authentication: Kerberos KDC Kerbe ...

  4. Linux安装Jdk,CentOS安装Jdk

    Linux安装Jdk,CentOS安装Jdk >>>>>>>>>>>>>>>>>>>& ...

  5. MVC中HttpContext, HttpContextBase, HttpContextWrapper联系

    HttpContext // // 摘要: // 封装有关个别 HTTP 请求的所有 HTTP 特定的信息. public sealed class HttpContext : IServicePro ...

  6. 自定义带有图片的PreferenceActivity

    http://my.oschina.net/huangsm/blog/40027 和大家分享一下关于android中PreferenceActivity使用以及为配置信息文件中添加图标的功能,首先给大 ...

  7. linq 中的分组查询

    直接看代码: //一个字段分组 var data1 = from a in query group a by a.Name into b select new { Total = b.Sum(c=&g ...

  8. 通过C#去调用C++编写的DLL

    这个问题缠了我2个小时才弄出来,其实很简单.当对方提供一个dll给你使用时,你需要去了解这个dll 是由什么语言写的,怎么编译的,看它的编译类型.这样即使在没有头绪时,你可以先尝使用一些比较热门的编译 ...

  9. vi 替换字符串

    假如说我想把该文件中所有的Web替换成SOR_SYS,那么我们可以用vi打开该文件,然后按一下: 你的命令行的最后一行会出现:,这个时候就是提醒你输入替换的命令 %s/Web/SOR_SYS/g 按一 ...

  10. 谷歌的C++智能指针实现

    //智能指针基类所有智能指针对象都继承该类class RefCountedBase { public: ; ; protected: virtual ~RefCountedBase(){} }; 智能 ...