2017 Multi-University Training Contest - Team 4
日常绝望系列
Questionnaire
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
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的更多相关文章
- 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 ...
- 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 ...
随机推荐
- windows Git的安装和使用
一.本人是根据廖雪峰大神的个人官网学习的git,并有感而发以做笔记的方式写下这篇博客,希望可以帮助到自己和其他人,廖雪峰个人官网http://www.liaoxuefeng.com/ 二.声明我的电脑 ...
- jmeter中文件上传配置
- 洛谷 P2264 情书
题目背景 一封好的情书需要撰写人全身心的投入.lin_toto同学看上了可爱的卡速米想对她表白,但却不知道自己写的情书是否能感动她,现在他带着情书请你来帮助他. 题目描述 为了帮助lin_toto,我 ...
- codevs 1683 车厢重组(水题日常)
时间限制: 1 s 空间限制: 1000 KB 题目等级 : 白银 Silver 题目描述 Description 在一个旧式的火车站旁边有一座桥,其桥面可以绕河中心的桥墩水平旋转.一个车站的职工 ...
- decompressedResponseImageOfSize:completionHandler:]_block_invoke
原因: It turns out the linker error was caused by the CGImageSourceCreateWithData call. And the root ...
- Lesson1
#ifdef __cplusplus #include <cstdlib> #else #include <stdlib.h> #endif #include <SDL/ ...
- stringstream类的简介和用法
一.简介 <sstream>类库定义了三种类:istringstream,ostringstream,stringstream.分别用来进行流的输入,流的输出,输入输出操作.在此演示str ...
- WPF中给Button加上图标和文字
要实现在Button里面加入图标或者图形以及文字,我们就需要在Button里面用一个WrapPanel控件,这个WrapPanel控件会把我们的图标或者文字进行包裹,并显示出来. Xaml: < ...
- django 第一次运行出错
直接运行整个项目正常,直接运行url文件报错 报错内容: E:\Python\python.exe D:/Python储存文件/ceshiweb/ceshiweb/urls.pyTraceback ( ...
- webuploader项目中多文件上传实例
<!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content ...