Google Code Jam 第一题
通过的第一题,留做纪念,呵呵,非常简单,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 第一题的更多相关文章
- [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 ...
- [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 ...
- [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 ...
- [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 ...
- 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 ...
- 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 ...
- 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 ...
- 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 ...
- 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 ...
随机推荐
- SSH搭建完美CURD,含分页算法
今日开始研究使用java平台上的框架解决web服务端的开发. 这是一个完整的SSH实例,在马士兵老师的SSH整合代码基础上,增加用户的增删改查,同时实现structs方式的分页 放出源代码供大家学习参 ...
- pymssql 安装测试
平台 : windows 7 32位 数据库 : SQLSERVER 2008 python 2.7 & pymssql模块 数据库和python 等模块安装说明省略 以下贴出测试代码: 单 ...
- 导入NGUI插件
在Unity编辑器顶部菜单栏中的Assets菜单中选择Import Package,然后选择Custom Package(自定义资源包),弹出资源路径窗口,在其中找到NGUI资源包所在的位置,单击”打 ...
- DRUID连接池的简单使用
DRUID——为监控而生的DB池 1. DRUID介绍 DRUID是阿里巴巴开源平台上一个数据库连接池实现,它结合了C3P0.DBCP.PROXOOL等DB池的优点,同时加入了日志监控,可以很好的监 ...
- [jobdu]孩子们的游戏(圆圈中最后剩下的数)
这道题就是典型的约瑟夫环问题.http://blog.csdn.net/wuzhekai1985/article/details/6628491 一开始想了一下用数组来做,就是模拟方法,同时记录一下是 ...
- 8. Unity异常警告错误处理方法
一. The AnimationClip 'cube1_anim' used by the Animation component 'Cube1' must be marked as Legacy. ...
- VMware与宿敌Amazon一笑泯恩仇:重新定义混合云?(私有云节节败退)
摘要: 私有云巨头VMware看来是真的要输给一个“书贩子” 了!这意味着私有云将败给公有云? [阅读原文] 三年前,虚拟化巨头VMware曾对亚马逊Amazon云服务AWS竖过中指:我们怎么可能打不 ...
- 弱安全协议探测工具-sslciphercheck
SSL(Secure Sockets Layer 安全套接层),及其继任者传输层安全(Transport Layer Security,TLS)是为 网络通信提供安全及数据完整性的一种安全协议.TLS ...
- C语言中的宏总结
宏定义分为两种: 1.变量式宏定义,如 #define abc def #define str "string" #define num 100 2.函数式宏定义, #define ...
- Outlook接收qq的邮件
1.先去qq邮箱,设置,账户 开启pop3服务,假如之前开启过,最好关闭之后重新开启 最新版本的必须使用邮箱的独立密码才可以收取邮件 (否则就算你之前开通了,也无法用你的qq账号和密码收取邮件的) 2 ...