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

  1. #include <cstdio>
  2. #include <cstring>
  3. #include <algorithm>
  4. using namespace std;
  5.  
  6. int n;
  7. int a[];
  8. int main()
  9. {
  10. int t1=,t2=;
  11. scanf("%d",&n);
  12. for(int i=; i<=n; i++)
  13. {
  14. scanf("%d",&a[i]);
  15. if(a[i]==) t1++;
  16. else t2++;
  17. }
  18. if(t1==)
  19. {
  20. printf("-1\n");
  21. }
  22. else if(t2<)
  23. {
  24. printf("0\n");
  25. }
  26. else
  27. {
  28. for(int i=; i<=t2/; i++)
  29. {
  30. for(int j=; j<=; j++)
  31. {
  32. printf("");
  33. }
  34. }
  35. for(int i=; i<=t1; i++) printf("");
  36. printf("\n");
  37. }
  38. }

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. Zookeeper,也要接触起来啦

    分布式的东东,就是部署也方便,但管理,想法,大集群应用是要点...! 参考如下URL简单实现 ,以后应用时多留意. http://blog.csdn.net/shirdrn/article/detai ...

  2. RSYSLOG没那么简单

    定义系统默认的日志收集还算EASY. 但如何在公司项目里要配置程序员们写的自定义日志,那可能就要用到LOCAL及FILTER过滤这些东东了... 慢慢走吧.. 收集URL备用,都是讲LOCAL,TEM ...

  3. C++中实现回调机制的几种方式(一共三种方法,另加三种)

    (1)Callback方式Callback的本质是设置一个函数指针进去,然后在需要需要触发某个事件时调用该方法, 比如Windows的窗口消息处理函数就是这种类型. 比如下面的示例代码,我们在Down ...

  4. jquery 实现全选反选

    jquery代码 $(function () { $('#inputCheck').click(function () { if ($(this).attr("checked")) ...

  5. windows oid 利用SNMP获得主机信息(转)

    该博文转至:http://blog.sina.com.cn/s/blog_853cc55b0101a2mq.html Windows OID' for CPU, Memory, Disk Utiliz ...

  6. eucMenu

  7. 面试时遇到的SQL

    CustomerID DateTime ProductName Price C001 2014-11-20 16:02:59 123 PVC 100 C001 2014-11-19 16:02:59 ...

  8. 万恶DevExpress

    公司需要,开始了DevExpress的学习之旅,说它万恶也只是在不了解它的情况下,熟悉之后能很方便的实现很多想要的功能 这里简单写一下要整理的内容,也就是大纲,以后再慢慢添加 一.控件和组件 date ...

  9. 信息熵(Entropy)究竟是用来衡量什么的?

    信息熵(Entropy)究竟是用来衡量什么的? ——与Philip ZHANG商榷 思明 Philip ZHANG先生在反驳彭小明的时候,提出一个观点,他说:“ 就语言文 字来说,总体效率不是用民族主 ...

  10. [Angular 2] Using the @Inject decorator

    TypeScript is used heavily as we build up our application, but TypeScript isn’t required. If you wan ...