日常绝望系列

Questionnaire

HDU - 6075

In 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 aiai to represent his opinion. When finished, the leader will choose a pair of positive interges m(m>1)m(m>1) and k(0≤k<m)k(0≤k<m), and regard those people whose number is exactly kk modulo mm 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 mm and kk.

InputThe first line of the input contains an integer T(1≤T≤15)T(1≤T≤15), denoting the number of test cases.

In each test case, there is an integer n(3≤n≤100000)n(3≤n≤100000) in the first line, denoting the number of people in the ACM/ICPC team.

In the next line, there are nn distinct integers a1,a2,...,an(1≤ai≤109)a1,a2,...,an(1≤ai≤109), denoting the number that each person chosen.OutputFor each test case, print a single line containing two integers m and k, if there are multiple solutions, print any of them.

Sample Input

1

6

23 3 18 8 13 9

Sample Output

5 3

这道题最水,看到特判又是膜的,那么m肯定是2啊,这样的话k只有两种结果,模拟下,so easy

#include<bits/stdc++.h>
using namespace std;
int main(){
int T;
scanf("%d",&T);
while(T--){
int n;
scanf("%d",&n);
int one=;
for(int i=;i<n;i++){
int x;
scanf("%d",&x);
if(x&)one++;
}
int f=;
if(one>=(n+)/)f=;
printf("2 %d\n",f);
}
return ;}

Time To Get Up

HDU - 6077

Little 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 55alarms, 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.

InputThe first line of the input contains an integer T(1≤T≤1440)T(1≤T≤1440), denoting the number of test cases.

In each test case, there is an 7×217×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.OutputFor each test case, print a single line containing a string tt in the format of HH:MMHH:MM, where t(00:00≤t≤23:59)t(00:00≤t≤23:59), denoting the time shown on the clock.Sample Input

1
.XX...XX.....XX...XX.
X..X....X......X.X..X
X..X....X.X....X.X..X
......XX.....XX...XX.
X..X.X....X....X.X..X
X..X.X.........X.X..X
.XX...XX.....XX...XX.

Sample Output

02:38

模拟啦,暴力一下就行,分情况讨论7个位置有没有,表示我在这方面的能力有些弱哎

#include<bits/stdc++.h>
using namespace std;
char s[][];
int dfs(int x,int y){
if(s[x][y+]=='X'){
if(s[x+][y+]!='X'){
if(s[x+][y]=='X')
return ;
else
return ;
}
else{
if(s[x+][y+]!='X'){
if(s[x+][y]=='X')
return ;
else return ;
}
else if(s[x+][y+]!='X')
return ;
else if(s[x+][y]=='X')
return ;
else if(s[x+][y]=='X')
return ;
else return ; }
}
else {
if(s[x+][y]=='X')
return ;
else return ;
}
}
int main(){
int T;
scanf("%d",&T);
while(T--){
getchar();
for(int i=;i<;i++)
scanf("%s",s[i]);
printf("%d%d:%d%d\n",dfs(,),dfs(,),dfs(,),dfs(,));
}
return ;}

2017 Multi-University Training Contest - Team 4的更多相关文章

  1. 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) ...

  2. 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 ...

  3. 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 ...

  4. 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 ...

  5. 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 ...

  6. 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 ...

  7. 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 ...

  8. 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 ...

  9. 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 ...

  10. 2017 Multi-University Training Contest - Team 1 1001&&HDU 6033 Add More Zero【签到题,数学,水】

    Add More Zero Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others)T ...

随机推荐

  1. I/O————字节流

    InputStream字节输入流 OutputStream字节输出流 用于以字节的形式读取和写入数据 下面是使用 字节输入流读取文件字节输出流写入文件 文件可能不存在,所以使用try catch pu ...

  2. WebService学习之旅(三)JAX-WS与Spring整合发布WebService

    Spring本身就提供了对JAX-WS的支持,有兴趣的读者可以研究下Spring的Spring-WS项目,项目地址: http://docs.spring.io/spring-ws/sites/1.5 ...

  3. 【extjs6学习笔记】0.2 准备:类库结构

  4. Windows系统下Android开发环境搭建

    “工具善其事,必先利其器”.要想学好Android,搭建好Android开发环境是一个良好的开端. Windows系统下Android开发环境主要有4个大的步骤.分别是: 1.JDK的安装 2.ecl ...

  5. _T(x) _TEXT(x) L 代表什么?

    首先  <tchar.h>中 #ifdef  _UNICODE .... #define __T(x)      L ## x  //替换 #else   /* ndef _UNICODE ...

  6. 状态压缩---区间dp第一题

    标签: ACM 题目 Gappu has a very busy weekend ahead of him. Because, next weekend is Halloween, and he is ...

  7. SAP云平台,Netweaver,Kubernetes和C4C的用户和角色关系

    SAP云平台 Netweaver 同SAP云平台一样,在事务码PFCG里维护角色: 然后在事务码SU01里将多个角色分配给用户: Kubernetes Kubernetes在1.3版本中发布了alph ...

  8. CNNs 在图像分割中应用简史: 从R-CNN到Mask R-CNN

    作者:嫩芽33出处:http://www.cnblogs.com/nenya33/p/6756024.html 版权:本文版权归作者和博客园共有 转载:欢迎转载,但未经作者同意,必须保留此段声明:必须 ...

  9. Python学习日志9月16日

    刚才我差点睡着了,差资料的时候太费神,有些累. 今天早晨学习了<head first HTML and CSS>,今天把昨天没看了的关于字体和颜色的一章节看完了,真长.我详细的做了笔记,并 ...

  10. Fedora19添加和设置YUM源

    Fedora19添加和设置YUM源添加yum源前先安装fastestmirror/downloadonly插件和axelget插件: 1.安装fastestmirror/downloadonly插件 ...