Codeforces Round #204 (Div. 2): A
超级大水题;
只要用到一个小学用过的结论就可;能被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的更多相关文章
- CF&&CC百套计划3 Codeforces Round #204 (Div. 1) A. Jeff and Rounding
http://codeforces.com/problemset/problem/351/A 题意: 2*n个数,选n个数上取整,n个数下取整 最小化 abs(取整之后数的和-原来数的和) 先使所有的 ...
- 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 ...
- CF&&CC百套计划3 Codeforces Round #204 (Div. 1) E. Jeff and Permutation
http://codeforces.com/contest/351/problem/E 题意: 给出一些数,可以改变任意数的正负,使序列的逆序对数量最少 因为可以任意加负号,所以可以先把所有数看作正数 ...
- CF&&CC百套计划3 Codeforces Round #204 (Div. 1) B. Jeff and Furik
http://codeforces.com/contest/351/problem/B 题意: 给出一个n的排列 第一个人任选两个相邻数交换位置 第二个人有一半的概率交换相邻的第一个数>第二个数 ...
- CF&&CC百套计划3 Codeforces Round #204 (Div. 1) D. Jeff and Removing Periods
http://codeforces.com/problemset/problem/351/D 题意: n个数的一个序列,m个操作 给出操作区间[l,r], 首先可以删除下标为等差数列且数值相等的一些数 ...
- Codeforces Round #204 (Div. 2) A.Jeff and Digits
因为数字只含有5或0,如果要被90整除的话必须含有0,否则输出-1 如果含有0的话,就只需考虑组合的数字之和是9的倍数,只需要看最大的5的个数能否被9整数 #include <iostream& ...
- 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 ...
- 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 ...
- Codeforces Round #204 (Div. 2) C
写了一记忆化 TLE了 把double换成long long就过了 double 这么耗时间啊 #include <iostream> #include<cstdio> #i ...
- Codeforces Round #204 (Div. 2): B
很简单的一个题: 只需要将他们排一下序,然后判断一下就可以了! 代码: #include<cstdio> #include<algorithm> #define maxn 10 ...
随机推荐
- Linux下top订购具体解释
Linux下top订购具体解释 watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvempmMjgwNDQxNTg5/font/5a6L5L2T/fontsize ...
- 数据库修复工具 - DatabaseCompressor 之从9M到900K+
数据库修复工具 - 仅限 *.mdb 格式的Access 数据库 引言: Access数据库操作有一严重Bug,当数据库文件内容添加�时,其文件容量随之添加�,但当删除数据库内容时,其数据库容量不会对 ...
- IO负载高的来源定位 IO系列
http://elf8848.iteye.com/category/281637 前言: 在一般运维工作中经常会遇到这么一个场景,服务器的IO负载很高(iostat中的util),但是无法快速的定位到 ...
- hadoop错误Could not obtain block blk_XXX_YYY from any node:java.io.IOException:No live nodes contain current block
错误: 10/12/08 20:10:31 INFO hdfs.DFSClient: Could not obtain block blk_XXXXXXXXXXXXXXXXXXXXXX_YYYYYYY ...
- one problem about Apple Keychain in use
解决方案 Add Security.framework, then rebuild. Sometimes I find I have to build clean and then rebuild. ...
- window和Linux下的软链接
window下开启软链接命令: mklink /J "D:\IdeaProjects\bms_work\smartcity_govnet\base_web\target\base_web\ ...
- 第三天关于网页sip的学习。平台win7 64位 freeSwitch jssip架构web网络电话
上次我们出现了一种问题就是,当我们采用iis架构出jssipweb端的时候,我们无法注册freeswitch的电话.. 我们用别的客户端已经成功能够互通电话,可以录音,唯独使用jssip架构的web端 ...
- java 开发基础篇1环境安装--eclipse安装教程
如何安装java环境 http://jingyan.baidu.com/article/a24b33cd59b58e19fe002bb9.html JDK download http://www.or ...
- C# Struct的内存布局
转载:http://www.csharpwin.com/csharpspace/10454r4891.shtml 问题:请说出以下struct的实例大小以及内存布局 struct Struct1 { ...
- RABBITMQ安装注意点
关于 RABBITMQ的配置问题安装问题windows7 和window 10我都试了windows10安装和配置不要出现中文和空格,不然你日寒飞的心都有了ERLANG的安装也是Win7直接默认的路径 ...