日常绝望系列

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. linux安装redis官方教程

    官方链接:http://redis.io/download Download, extract and compile Redis with: $ wget http://download.redis ...

  2. [BZOJ1047][HAOI2007]理想的正方形 二维单调队列

    题目链接:http://www.lydsy.com/JudgeOnline/problem.php?id=1047 我们对每矩阵的一列维护一个大小为$n$的单调队列,队中元素为矩阵中元素.然后扫描每一 ...

  3. ES-windos环搭建-ik中文分词器

    ik下载 打开Github官网,搜索elasticsearch-analysis-ik,单击medcl/elasticsearch-analysis-ik.或者直接点击 在readme.md文件中,下 ...

  4. 从零开始利用vue-cli搭建简单音乐网站(四)

    上一篇文章中说到这一篇博客会实现音乐播放功能,只是令我意外的是,如果利用h5的audio标签,几行代码就实现了......先来看一下最终效果吧. 这里直接用了audio标签,样式没有怎么管,能获得音乐 ...

  5. 20170308web作业1

    代码20170308001: <%@ page language="java" import="java.util.*" pageEncoding=&qu ...

  6. css命名规范—CSS样式命名整理

    CSS样式命名整理 页面结构 容器: container/wrap整体宽度:wrapper页头:header内容:content页面主体:main页尾:footer导航:nav侧栏:sidebar栏目 ...

  7. uvm_sequence_item——sequence机制(一)

    让子弹飞一会 UVM框架,将验证平台和激励分开,env以下属于平台部分,test和sequence属于激励,这样各司其职.我们可以将sequence_item 比喻成子弹,sequencer 类比成弹 ...

  8. SQL 数学串函数

    数学函数 ceiling  取上限 floor  取下限 round 四舍五入 len   长度 abs  绝对值 PI()圆周率 sqrt 开根号 qwuare 平方根 select  10     ...

  9. php日期时间和时间戳转化

    echo date("Y-m-d H:i:s", 1409138643);echo strtotime('2014-08-28 23:00:00');

  10. 签名ipa,让其它手机也安装

    开发的时候,需要将app让其它人装上测试,虽然通过xcode可以使用编译进去,但是仍显不方便. 网上有个工具, http://code.google.com/p/iresign/ 通过这个工具,使用自 ...