通过的第一题,留做纪念,呵呵,非常简单,Africa 2010, Qualification Round: Store Credit。

  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int main(void)
  5. {
  6. int N,C,I;
  7. int *p;
  8. int i,j,k;
  9. freopen("in.in", "r", stdin);
  10. freopen("out", "w", stdout);
  11. scanf("%d",&N);
  12. for(i=;i<=N;i++)
  13. {
  14.  
  15. scanf("%d",&C);
  16. scanf("%d",&I);
  17.  
  18. p=(int *)malloc(sizeof(int)*I);
  19. for(j=;j<I;j++)
  20. {
  21. scanf("%d",p+j);
  22.  
  23. for(k=;k<j;k++)
  24. if(p[k]+p[j]==C)
  25. goto out;
  26. }
  27.  
  28. out: printf("Case #%d: %d %d\n",i,k+,j+);
  29.  
  30. while (getchar()!='\n')
  31. ;
  32. free(p);
  33.  
  34. }
  35. }

Credit.c

Google Code Jam 第一题的更多相关文章

  1. [Google Code Jam (Qualification Round 2014) ] A. Magic Trick

    Problem A. Magic Trick Small input6 points You have solved this input set.   Note: To advance to the ...

  2. [C++]Store Credit——Google Code Jam Qualification Round Africa 2010

    Google Code Jam Qualification Round Africa 2010 的第一题,很简单. Problem You receive a credit C at a local ...

  3. [C++]Saving the Universe——Google Code Jam Qualification Round 2008

    Google Code Jam 2008 资格赛的第一题:Saving the Universe. 问题描述如下: Problem The urban legend goes that if you ...

  4. [Google Code Jam (Qualification Round 2014) ] B. Cookie Clicker Alpha

    Problem B. Cookie Clicker Alpha   Introduction Cookie Clicker is a Javascript game by Orteil, where ...

  5. Google Code Jam Africa 2010 Qualification Round Problem B. Reverse Words

    Google Code Jam Africa 2010 Qualification Round Problem B. Reverse Words https://code.google.com/cod ...

  6. Google Code Jam Africa 2010 Qualification Round Problem A. Store Credit

    Google Code Jam Qualification Round Africa 2010 Problem A. Store Credit https://code.google.com/code ...

  7. Google Code Jam 2010 Round 1C Problem A. Rope Intranet

    Google Code Jam 2010 Round 1C Problem A. Rope Intranet https://code.google.com/codejam/contest/61910 ...

  8. Google Code Jam 2014 资格赛:Problem B. Cookie Clicker Alpha

    Introduction Cookie Clicker is a Javascript game by Orteil, where players click on a picture of a gi ...

  9. Google Code Jam 资格赛: Problem A. Magic Trick

    Note: To advance to the next rounds, you will need to score 25 points. Solving just this problem wil ...

随机推荐

  1. SSH搭建完美CURD,含分页算法

    今日开始研究使用java平台上的框架解决web服务端的开发. 这是一个完整的SSH实例,在马士兵老师的SSH整合代码基础上,增加用户的增删改查,同时实现structs方式的分页 放出源代码供大家学习参 ...

  2. pymssql 安装测试

    平台 : windows 7 32位 数据库 : SQLSERVER 2008 python 2.7  & pymssql模块 数据库和python 等模块安装说明省略 以下贴出测试代码: 单 ...

  3. 导入NGUI插件

    在Unity编辑器顶部菜单栏中的Assets菜单中选择Import Package,然后选择Custom Package(自定义资源包),弹出资源路径窗口,在其中找到NGUI资源包所在的位置,单击”打 ...

  4. DRUID连接池的简单使用

    DRUID——为监控而生的DB池 1.  DRUID介绍 DRUID是阿里巴巴开源平台上一个数据库连接池实现,它结合了C3P0.DBCP.PROXOOL等DB池的优点,同时加入了日志监控,可以很好的监 ...

  5. [jobdu]孩子们的游戏(圆圈中最后剩下的数)

    这道题就是典型的约瑟夫环问题.http://blog.csdn.net/wuzhekai1985/article/details/6628491 一开始想了一下用数组来做,就是模拟方法,同时记录一下是 ...

  6. 8. Unity异常警告错误处理方法

    一. The AnimationClip 'cube1_anim' used by the Animation component 'Cube1' must be marked as Legacy. ...

  7. VMware与宿敌Amazon一笑泯恩仇:重新定义混合云?(私有云节节败退)

    摘要: 私有云巨头VMware看来是真的要输给一个“书贩子” 了!这意味着私有云将败给公有云? [阅读原文] 三年前,虚拟化巨头VMware曾对亚马逊Amazon云服务AWS竖过中指:我们怎么可能打不 ...

  8. 弱安全协议探测工具-sslciphercheck

    SSL(Secure Sockets Layer 安全套接层),及其继任者传输层安全(Transport Layer Security,TLS)是为 网络通信提供安全及数据完整性的一种安全协议.TLS ...

  9. C语言中的宏总结

    宏定义分为两种: 1.变量式宏定义,如 #define abc def #define str "string" #define num 100 2.函数式宏定义, #define ...

  10. Outlook接收qq的邮件

    1.先去qq邮箱,设置,账户 开启pop3服务,假如之前开启过,最好关闭之后重新开启 最新版本的必须使用邮箱的独立密码才可以收取邮件 (否则就算你之前开通了,也无法用你的qq账号和密码收取邮件的) 2 ...