HDU 2017 Multi-University Training Contest - Team 4 1009 1011
Questionnaire
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 524288/524288 K (Java/Others)
Total Submission(s): 422 Accepted Submission(s): 320
Special Judge
order to get better results in official ACM/ICPC contests, the team
leader comes up with a questionnaire. He asked everyone in the team
whether to have more training.
Picture from Wikimedia Commons
Obviously
many people don't want more training, so the clever leader didn't write
down their words such as ''Yes'' or ''No''. Instead, he let everyone
choose a positive integer ai to represent his opinion. When finished, the leader will choose a pair of positive interges m(m>1) and k(0≤k<m), and regard those people whose number is exactly k modulo m
as ''Yes'', while others as ''No''. If the number of ''Yes'' is not
less than ''No'', the leader can have chance to offer more training.
Please help the team leader to find such pair of m and k.
In each test case, there is an integer n(3≤n≤100000) in the first line, denoting the number of people in the ACM/ICPC team.
In the next line, there are n distinct integers a1,a2,...,an(1≤ai≤109), denoting the number that each person chosen.
6
23 3 18 8 13 9
#include <iostream>
#include <algorithm>
#include <cstring>
#include <cstdio>
#include <vector>
#include <queue>
#include <cstdlib>
#include <iomanip>
#include <cmath>
#include <ctime>
#include <map>
#include <set>
using namespace std;
#define lowbit(x) (x&(-x))
#define max(x,y) (x>y?x:y)
#define min(x,y) (x<y?x:y)
#define MAX 100000000000000000
#define MOD 1000000007
#define pi acos(-1.0)
#define ei exp(1)
#define PI 3.141592653589793238462
#define ios() ios::sync_with_stdio(false)
#define INF 0x3f3f3f3f
#define mem(a) (memset(a,0,sizeof(a)))
typedef long long ll;
int x,t,n;
int main()
{
scanf("%d",&t);
while(t--)
{
scanf("%d",&n);
int pos=,ans=;
for(int i=;i<n;i++)
{
scanf("%d",&x);
if(x&) ans++;
else pos++;
}
puts(ans>pos?"2 1":"2 0");
}
}
Time To Get Up
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 524288/524288 K (Java/Others)
Total Submission(s): 458 Accepted Submission(s): 362
Q's clock is alarming! It's time to get up now! However, after reading
the time on the clock, Little Q lies down and starts sleeping again.
Well, he has 5 alarms, and it's just the first one, he can continue sleeping for a while.
Little
Q's clock uses a standard 7-segment LCD display for all digits, plus
two small segments for the '':'', and shows all times in a 24-hour
format. The '':'' segments are on at all times.
Your job is to help Little Q read the time shown on his clock.
In each test case, there is an 7×21 ASCII image of the clock screen.
All
digit segments are represented by two characters, and each colon
segment is represented by one character. The character ''X'' indicates a
segment that is on while ''.'' indicates anything else. See the sample
input for details.
#include <iostream>
#include <algorithm>
#include <cstring>
#include <cstdio>
#include <vector>
#include <queue>
#include <cstdlib>
#include <iomanip>
#include <cmath>
#include <ctime>
#include <map>
#include <set>
using namespace std;
#define lowbit(x) (x&(-x))
#define max(x,y) (x>y?x:y)
#define min(x,y) (x<y?x:y)
#define MAX 100000000000000000
#define MOD 1000000007
#define pi acos(-1.0)
#define ei exp(1)
#define PI 3.141592653589793238462
#define ios() ios::sync_with_stdio(false)
#define INF 0x3f3f3f3f
#define mem(a) (memset(a,0,sizeof(a)))
typedef long long ll;
char s[][];
int a[][],n;
int solve(int *a)
{
if(a[]== && a[]== && a[]== && a[]== && a[]== && a[]== && a[]==) return ;
if(a[]== && a[]== && a[]== && a[]== && a[]== && a[]== && a[]==) return ;
if(a[]== && a[]== && a[]== && a[]== && a[]== && a[]== && a[]==) return ;
if(a[]== && a[]== && a[]== && a[]== && a[]== && a[]== && a[]==) return ;
if(a[]== && a[]== && a[]== && a[]== && a[]== && a[]== && a[]==) return ;
if(a[]== && a[]== && a[]== && a[]== && a[]== && a[]== && a[]==) return ;
if(a[]== && a[]== && a[]== && a[]== && a[]== && a[]== && a[]==) return ;
if(a[]== && a[]== && a[]== && a[]== && a[]== && a[]== && a[]==) return ;
if(a[]== && a[]== && a[]== && a[]== && a[]== && a[]== && a[]==) return ;
if(a[]== && a[]== && a[]== && a[]== && a[]== && a[]== && a[]==) return ; }
int main()
{
scanf("%d",&n);
while(n--)
{
memset(a,,sizeof(a));
for(int i=;i<=;i++)
{
scanf("%s",s[i]+);
}
if(s[][]=='X') a[][]=;
if(s[][]=='X') a[][]=;
if(s[][]=='X') a[][]=;
if(s[][]=='X') a[][]=;
if(s[][]=='X') a[][]=;
if(s[][]=='X') a[][]=;
if(s[][]=='X') a[][]=;
if(s[][]=='X') a[][]=;
if(s[][]=='X') a[][]=;
if(s[][]=='X') a[][]=;
if(s[][]=='X') a[][]=;
if(s[][]=='X') a[][]=;
if(s[][]=='X') a[][]=;
if(s[][]=='X') a[][]=;
if(s[][]=='X') a[][]=;
if(s[][]=='X') a[][]=;
if(s[][]=='X') a[][]=;
if(s[][]=='X') a[][]=;
if(s[][]=='X') a[][]=;
if(s[][]=='X') a[][]=;
if(s[][]=='X') a[][]=;
if(s[][]=='X') a[][]=;
if(s[][]=='X') a[][]=;
if(s[][]=='X') a[][]=;
if(s[][]=='X') a[][]=;
if(s[][]=='X') a[][]=;
if(s[][]=='X') a[][]=;
if(s[][]=='X') a[][]=;
printf("%d%d:%d%d\n",solve(a[]),solve(a[]),solve(a[]),solve(a[]));
}
return ;
}
HDU 2017 Multi-University Training Contest - Team 4 1009 1011的更多相关文章
- 2017 Multi-University Training Contest - Team 9 1005&&HDU 6165 FFF at Valentine【强联通缩点+拓扑排序】
FFF at Valentine Time Limit: 6000/3000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others) ...
- 2017 Multi-University Training Contest - Team 9 1004&&HDU 6164 Dying Light【数学+模拟】
Dying Light Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)Tot ...
- 2017 Multi-University Training Contest - Team 9 1003&&HDU 6163 CSGO【计算几何】
CSGO Time Limit: 20000/10000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Subm ...
- 2017 Multi-University Training Contest - Team 9 1002&&HDU 6162 Ch’s gift【树链部分+线段树】
Ch’s gift Time Limit: 6000/3000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total S ...
- 2017 Multi-University Training Contest - Team 9 1001&&HDU 6161 Big binary tree【树形dp+hash】
Big binary tree Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)T ...
- 2017 Multi-University Training Contest - Team 1 1003&&HDU 6035 Colorful Tree【树形dp】
Colorful Tree Time Limit: 6000/3000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)T ...
- 2017 Multi-University Training Contest - Team 1 1006&&HDU 6038 Function【DFS+数论】
Function Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)Total ...
- 2017 Multi-University Training Contest - Team 1 1002&&HDU 6034 Balala Power!【字符串,贪心+排序】
Balala Power! Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)T ...
- 2017 Multi-University Training Contest - Team 1 1011&&HDU 6043 KazaQ's Socks【规律题,数学,水】
KazaQ's Socks Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)T ...
随机推荐
- ELK到底是什么?那么多公司用!__转载
Sina.饿了么.携程.华为.美团.freewheel.畅捷通 .新浪微博.大讲台.魅族.IBM...... 这些公司都在使用ELK!ELK!ELK! ELK竟然重复了三遍,是个什么? 一.ELK ...
- Goldengate参数规范
1. 文档综述 1.1. 文档说明 本文档规定了在实施Goldengate时,各个进程需要配置的参数. 该参数模板适合于Goldengate11.2.1.0版本: **注:本文档为Golden ...
- BZOJ 3637: Query on a tree VI LCT_维护子树信息_点权转边权_好题
非常喜欢这道题. 点权转边权,这样每次在切断一个点的所有儿子的时候只断掉一条边即可. Code: #include <cstring> #include <cstdio> #i ...
- 理解JavaScript Call()函数原理。
最近在做面试题的过程中偶然碰到关于call函数的问题.然后再百度上查了查.偶然看到一篇文章:JavaScript中的call.apply.bind深入理解 抛开其对call函数基本概念的介绍还有其他原 ...
- ArchLinux 音乐播放客户端ncmpcpp和服务端mpd的配置
Ncmcpp是一个mpd客户端,它提供了很多方便的操作 MPD是一个服务器-客户端架构的音频播放器.功能包括音频播放, 播放列表管理和音乐库维护,所有功能占用的资源都很少. --取自 wiki.arc ...
- word/excel/ppt 2 PDF
PHP 实现 word/excel/ppt 转换为 PDF 一般最常见的就是利用OpenOffice来转换,来看看实现的核心代码: class PDFConverter { private $com; ...
- CMSIS-RTOS 简介
CMSIS-RTOS API是基于Arm®Cortex®-M处理器的设备的通用RTOS接口.CMSIS-RTOS为需要RTOS功能的软件组件提供标准化API,从而为用户和软件行业带来了巨大的好处. C ...
- 137 - ZOJ Monthly, November 2014 - J Poker Face
Poker Face Time Limit: 2 Seconds Memory Limit: 65536 KB As is known to all, coders are lack of ...
- 常量成员函数的注意事项 & mutable的使用场景
mutable的使用场景: 可以在一个const的对象里面,解除对部分字段的const限制.也可以用在const成员函数里面. 对于const与否,一般会调用不同版本的函数: 而对于二元操作符,如果用 ...
- OpenCV学习笔记09--通过cvPtr2D或指针算法绘制图形
练习:创建一个1000*1000的三通道图像,将其元素所有置0.以(200,50)和(400,200)为顶点绘制一个绿色平面 我们能够用两种方法来实现这一功能,一个是使用cvPtr2D,可是因为使用了 ...