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

 #include <stdio.h>
#include <stdlib.h> int main(void)
{
int N,C,I;
int *p;
int i,j,k;
freopen("in.in", "r", stdin);
freopen("out", "w", stdout);
scanf("%d",&N);
for(i=;i<=N;i++)
{ scanf("%d",&C);
scanf("%d",&I); p=(int *)malloc(sizeof(int)*I);
for(j=;j<I;j++)
{
scanf("%d",p+j); for(k=;k<j;k++)
if(p[k]+p[j]==C)
goto out;
} out: printf("Case #%d: %d %d\n",i,k+,j+); while (getchar()!='\n')
;
free(p); }
}

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. 1.Bloom filter

    Bloom filter 是由 Howard Bloom 在 1970 年提出的二进制向量数据结构,它具有很好的空间和时间效率,被用来检测一个元素是不是集合中的一个成员,这种检测只会对在集合内的数据错 ...

  2. Oracle存储过程创建及调用(转)

    在大型数据库系统中,有两个很重要作用的功能,那就是存储过程和触发器.在数据库系统中无论是存储过程还是触发器,都是通过SQL 语句和控制流程语句的集合来完成的.相对来说,数据库系统中的触发器也是一种存储 ...

  3. 如何使用Promise

    在说Promise之前,不得不说一下JavaScript的嵌套的回调函数 在JavaScript语言中,无论是写浏览器端的各种事件处理回调.ajax回调,还是写Node.js上的业务逻辑,不得不面对的 ...

  4. import information website

    1. 一个很好的展示如何review paper和response to reviewer的网站:openview 该网站给出了许多paper review的例子(如何你是reviewer,那么可以参 ...

  5. 问题分享:ActiveX component can't create object: "MSComDlg.CommonDialog"

    问题描述: 修改一个前辈的代码,在我自己电脑上面运行的很好,但是放到要用户电脑(win7 x64)上面却跑不了,报个如题的错误. 查了下是COMDLG32.OCX的问题,用到控件的地方是: Dim o ...

  6. JavaScript中===与==的区别

    参考网址:http://zhidao.baidu.com/link?url=RbWnRUHKPBTakwm2-iRfEDicrh4ZSAAeVfq2WvBkvfeLPkU-ZSqZ4chV8LWkCk ...

  7. javascript技巧合集

    转http://www.blogjava.net/zhaochengming/archive/2010/04/09/317837.html http://www.cnblogs.com/fxgachi ...

  8. Hansight

    http://www.hansight.com/scenarios.html#account

  9. HDU 1176 免费馅饼(DP)

    点我看题目 题意 : 中文题.在直线上接馅饼,能接的最多是多少. 思路 :这个题其实以前做过.....你将这个接馅饼看成一个矩阵,也不能说是一个矩阵,反正就是一个行列俱全的形状,然后秒当行,坐标当列, ...

  10. SpringMVC与Struts2关于controller线程安全问题

    SpringMVC的controller是单例的,因此springMVC的controller不是线程安全的,在使用的时候要谨慎添加成员变量,因为所有的请求都会共享这个变量. 与springMVC不同 ...