URAL 2081 Faulty dial
题目:
Faulty dial
Input
._. ... ._. ._. ... ._. ._. ._. ._. ._.
|.| ..| ._| ._| |_| |_. |_. ..| |_| |_|
|_| ..| |_. ._| ..| ._| |_| ..| |_| ._|
Output
Example
input | output |
---|---|
2 |
03:12 |
思路:按时间从大到小搜就好了,代码还是挺短的,不过还是感觉被恶心到了。
#include <bits/stdc++.h> using namespace std; #define MP make_pair
#define PB push_back
typedef long long LL;
typedef pair<int,int> PII;
const double eps=1e-;
const double pi=acos(-1.0);
const int K=1e6+;
const int mod=1e9+; int ch[];
char ss[][];
char num[][]=
{ " ",
" ._....._.._....._.._.._.._.._.",
" |.|..|._|._||_||_.|_...||_||_|",
" |_|..||_.._|..|._||_|..||_|._|"
};
bool sc(int sk,int x,int y)
{
for(int i=;i<;i++)
for(int j=;j<;j++)
{
if(!(ss[sk+i][x+j]=='.'||ss[sk+i][x+j]==num[i+][y+j]))
return ;
}
return ;
} int main(void)
{
for(int i=;i<;i++)
ch[i]=i*+;
int t,ln=;cin>>t;
gets(ss[]);
for(int i=;i<=*t;i++)
gets(&ss[i][]);
for(int i=;i>=;i--)
for(int j=;j>=;j--)
for(int k=;k>=;k--)
for(int p=;p>=;p--)
if(sc(+ln*,,ch[i])&&sc(+ln*,,ch[j])&&sc(+ln*,,ch[k])&&sc(+ln*,,ch[p]))
{
printf("%d%d:%d%d\n",i,j,k,p);
if(++ln>=t)
return ;
}
while();
}
URAL 2081 Faulty dial的更多相关文章
- 【枚举】URAL - 2081 - Faulty dial
//._. ... ._. ._. ... ._. ._. ._. ._. ._. //|.| ..| ._| ._| |_| |_. |_. ..| |_| |_| //|_| ..| |_. ._ ...
- URAL 2078~2089
URAL 2078~2089 A - Bowling game 题目描述:给出保龄球每一局击倒的球数,按照保龄球的规则,算出总得分的最小值和最大值. solution 首先是最小值:每一局第一球击倒\ ...
- 如何为Surface Dial设备开发自定义交互功能
随着Surface Studio的发布,微软发布了与之相配套的外设硬件Surface Dial,用户可以将Surface Dail吸附在Surface Studio的屏幕上面,用旋转和点击的实体操作来 ...
- BZOJ 2081: [Poi2010]Beads
Description 问把n截成每个长度后不同子串个数. Sol 调和极数+Hash. 首先这是一个式子 \(n\sum_{i=1}^n \frac {1}{i}\) . 这东西就是调和极数再乘上 ...
- 后缀数组 POJ 3974 Palindrome && URAL 1297 Palindrome
题目链接 题意:求给定的字符串的最长回文子串 分析:做法是构造一个新的字符串是原字符串+反转后的原字符串(这样方便求两边回文的后缀的最长前缀),即newS = S + '$' + revS,枚举回文串 ...
- ural 2071. Juice Cocktails
2071. Juice Cocktails Time limit: 1.0 secondMemory limit: 64 MB Once n Denchiks come to the bar and ...
- ural 2073. Log Files
2073. Log Files Time limit: 1.0 secondMemory limit: 64 MB Nikolay has decided to become the best pro ...
- ural 2070. Interesting Numbers
2070. Interesting Numbers Time limit: 2.0 secondMemory limit: 64 MB Nikolay and Asya investigate int ...
- ural 2069. Hard Rock
2069. Hard Rock Time limit: 1.0 secondMemory limit: 64 MB Ilya is a frontman of the most famous rock ...
随机推荐
- 第一百三十六节,JavaScript,封装库--事件绑定
JavaScript,封装库--事件绑定 在函数库添加两个函数 添加事件绑定函数 删除事件绑定函数 添加事件绑定函数 /** addEvent()函数库函数,跨浏览器添加事件绑定,注意:传入事件名称时 ...
- ashx一般处理程序
说明: 虽然通过标准的方式可以创建处理程序,但是实现的步骤比较复杂,为了方便网站开发中对处理程序的应用,从Asp.net 2.0开始,asp.net提供了称为一般处理程序的处理程序,允许我们使用 ...
- 目标跟踪之卡尔曼滤波---理解Kalman滤波的使用
http://www.cnblogs.com/jcchen1987/p/4371439.html
- Pat(Advanced Level)Practice--1026(Table Tennis)
Pat1026代码 题目描写叙述: A table tennis club has N tables available to the public. The tables are numbered ...
- 马普尔小姐探案集S02E03【熙阳岭的疑云】
--Why the husband love his wife so much? --Because she was the last one in their family.
- web.config配置文件中的configSource属性
每个网站里都会有一个web.config文件.修改Web.config文件会导致IIS重启,就是随意的回车一下也会导致重启.微软建议,不要将需要修改的配置内容保存在web.config中.而是单独放在 ...
- python3----生成器generator(yield)
# 列表推导式a = [i for i in range(100) if not(i % 2) and (i % 3)]print(a)# 字典推导式b = {i: i % 2 == 0 for i ...
- 编写高质量代码--改善python程序的建议(四)
原文发表在我的博客主页,转载请注明出处! 建议十八:有节制的使用from...import语句 python提供了三种方式引入外部模块: import语句 from...import... __imp ...
- [Go语言]从Docker源码学习Go——main函数
Go程序从main包下的main函数开始执行,当main执行结束后,程序退出. Docker的main函数在 docker/docker/docker.go package main //Import ...
- freemarker的${!}
${sss!} <#--没有定义这个变量,默认值是空字符串! --> ...................................... 转自:https://blog.csdn ...