google code jam 2014 RB_A
来源:互联网 发布:mycat 性能优化 编辑:程序博客网 时间:2024/06/01 09:27
呵呵。
#include <cstdio>#include <iostream>#include <algorithm>using namespace std;int T,X,N,S[10001];int main(){freopen("A-large-practice.in","r",stdin);freopen("a.large","w",stdout);cin>>T;for(int cas=1; cas<=T; ++cas){cin>>N>>X;for(int i=0; i<N; ++i){cin>>S[i];}sort(S,S+N);int ans=0;for(int i=N-1,j=0; i>=j; --i){if(S[i]+S[j]<=X){++j;}++ans;}printf("Case #%d: %d\n",cas,ans);}}
0 0
- google code jam 2014 RB_A
- Google Code Jam 2014 -- C
- google code jam 2014 RC_A
- google code jam 2014 RC_B
- google code jam 2014 RC_C
- google code jam 2014 RC_D
- google code jam 2014 RB_B
- google code jam 2014 RB_C
- Google Code Jam 2014 A. Magic Trick
- Google Code Jam 2014 A,B,D
- Google Code Jam 2006
- Google China Code Jam
- Google Code Jam
- Google Code Jam 130914
- Google Code Jam 2015
- Google Code Jam 2015
- 2016 google code jam
- Google code jam
- mysql_store_result和mysql_use_result的区别
- NSData 日期 日期是由时间戳表示的,单位是秒
- linux内核地址空间
- strongswan ipsec 和思科 ASA5550 对接
- poj 1236 tarjan缩点(能达到全图的最少起点数)
- google code jam 2014 RB_A
- 关于C++中的友元函数的总结
- Java类集(接口继承的关系)
- bzoj 2458: [BeiJing2011]最小三角形 题解
- 华为上机--重复字符过滤
- 排列
- compare 比较常用方法 NSOrderedDescending 升序 NSOrderedSame 一样 NSOrderedAscending 降序
- AcRx库概述
- 搭建nForum