Codeforces Round #204 (Div. 2) A.Jeff and Digits
因为数字只含有5或0,如果要被90整除的话必须含有0,否则输出-1
如果含有0的话,就只需考虑组合的数字之和是9的倍数,只需要看最大的5的个数能否被9整数
#include <iostream>
#include <vector> using namespace std; int main(){
int n;
cin >> n;
int numOfZero = , numOfFive = ,tmp;
for(int i = ; i < n; ++ i){
cin>>tmp;
( tmp == ) ? (++numOfFive) : (++numOfZero);
}
if(numOfZero == ) cout<<-<<endl;
else{
while(numOfFive*% != && numOfFive-- );
for(int i = ; i < numOfFive; ++i ) cout<<;
if(numOfFive == ) cout<<;
else {
for(int i = ; i < numOfZero; ++ i) cout<<;
}
cout<<endl;
}
return ;
}
Codeforces Round #204 (Div. 2) A.Jeff and Digits的更多相关文章
- 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)->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. Jeff and Rounding——数学规律
给予N*2个数字,改变其中的N个向上进位,N个向下进位,使最后得到得数与原来数的差的绝对值最小 考虑小数点后面的数字,如果这些数都非零,则就是 abs(原数小数部分相加-1*n), 多一个0 则 m ...
- Codeforces Round #204 (Div. 2)
D. Jeff and Furik time limit per test 1 second memory limit per test 256 megabytes input standard in ...
随机推荐
- 【OpenStack】OpenStack系列17之OpenStack私有云设计一
[软件系统] 1.操作系统(Minimal最小化安装): CentOS-6.6-x86_64,CentOS 6最后一个版本,官方建议版本. 相对于6.5版本: 强化对 SCSI 设备的处理,有助应付某 ...
- Junit4测试
1.junit初级入门 2.常用注解 3.运行流程 4.测试套件使用 5.参数化设置
- 【JAVA、C++】LeetCode 013 Roman to Integer
Given a roman numeral, convert it to an integer. Input is guaranteed to be within the range from 1 t ...
- 1.saltstack基础笔记
环境: master: 节点node1:阿里云:121.42.195.15 centos6.6 minion: 节点node2:腾讯云:182.254.157.19 centos6.6 一.salts ...
- mybatis存入数据库后没有时分秒时间不全只有年月日
对于Ibatis操作Date/Time/DateTime,总结如下: 将pojo的属性类型设置为java.sql.Date(或java.sql.Time, java.sql.Timestamp),此时 ...
- 使用apktool工具遇到could not decode arsc file的解决办法
问题详情: 当前环境为 win7 64位 jdk1.7 apktool.jar(版本1.5.2) apktool(版本windows-r05-ibot) 使用的反编译工具和apk文件为 反编译 ...
- 如何给Eclipse中添加库(jar包)
折腾Eclipse时,经常会遇到这种情况: 缺少某个库,找到之后,需要将该库,jar包,加入到当前项目,使得代码中的import xxx得以正常导入. 举例: [已解决]Eclipse的java代码出 ...
- Ubuntu和windows共享文件夹
参考文章: http://www.cnblogs.com/zhengyuxin/articles/1938414.html
- 总结sqlserver数据库性能优化相关的注意事项
一.分析阶段一般来说,在系统分析阶段往往有太多需要关注的地方,系统各种功能性.可用性.可靠性.安全性需求往往吸引了我们大部分的注意力,但是,我们必须注意,性能是很重要的非功能性需求,必须根据系统的特点 ...
- ASP.NET Web.Config 读写辅助类
using System; using System.Configuration; using System.Web; using System.Web.Configuration; namespac ...