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 ...
随机推荐
- ReactiveCocoa简单使用20例
ReactiveCocoa简单使用20例 1. 观察值变化 你别动,你一动我就知道. //当self.value的值变化时调用Block,这是用KVO的机制,RAC封装了KVO @weakify(se ...
- Unix版权史
原文出处: 阮一峰 这几天,我在读<Unix编程艺术>. 书中介绍了Unix的发展历史.我发现,这是一个很好的例子,说明现行版权制度具有阻碍社会发展的负面作用. 2. Unix诞生于 ...
- Javascript中正则的 match、test、exec使用方法和区别
总结: match 是str调用 test和exec是正则表达式调用 test只返回true或false, exec和match的结果是相同的,返回结果比较复杂
- vue+element-ui的简洁导入导出功能
1.前段后台管理系统中数据展示一般都是用表格,表格会涉及到导入和导出;原生js导出excel2.导入是利用element-ui的Upload 上传组件; <el-upload class=&qu ...
- 人在IT,关于计算机专业的杂谈PPT
- Linux学习之socket编程(二)
Linux学习之socket编程(二) 1.C/S模型——UDP UDP处理模型 由于UDP不需要维护连接,程序逻辑简单了很多,但是UDP协议是不可靠的,实际上有很多保证通讯可靠性的机制需要在应用层实 ...
- 题解 P2431 【正妹吃月饼】
假如做这道题想着用如下朴实的模拟,那肯定要WA至少4个点. #include <iostream> #include <cstdio> using namespace std; ...
- OpenStack依然大行其道,可是否能等来属于自己的时代
版权声明:不论什么转载需全文转载并保留来源(微信公众号techculture)和该声明,并同一时候转载文后的二维码.否则视作侵权. OpenStack在云计算领域依然火热,甚至能够说势不可挡.这可能是 ...
- Qt 5.3 下OpenCV 2.4.11 开发(0)图像处理基本概念
1.普通情况下的RGB彩色图像:它的每一个像素点都是由三个通道组成,即红色(R).绿色(G)和蓝色(B).8位三通道彩色图像就是每一个像素中每一个通道的取值范围都是 0~255(即二进制下的8位数), ...
- CSS浏览器兼容问题集(一)
CSS对浏览器的兼容性有时让人非常头疼,也许当你了解其中的技巧跟原理,就会认为也不是难事,从网上收集了IE7,6与Fireofx的兼容性处理方法并整理了一下.对于web2.0的过度,请尽量用xhtml ...