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 ...
随机推荐
- xml传输过程中中文乱码
------------------------------------------request:----------------------------------------------- pu ...
- Matlab之合并音频
程序功能: 1.读入wav下的所有音频 2.每个音频截取前0.6秒 3.合并每个音频 clear all; cd = 'wav'; waveFiles = dir(fullfile(cd,'*.wav ...
- Cmake实现样例
多目录工程的CmakeLists.txt编写(自动添加多目录下的文件) http://www.cnblogs.com/chengxuyuancc/p/5347646.html 实现类似于vs中工程的C ...
- C++ namespace浅析
有一些C语言的基础,突然想看看C++,在Codeblocks上新建工程的时候会生成一个打印"Hello World"的程序,和C语言些许不同.其中最突出的就是"using ...
- 可以输入也可以下拉选择的select
网址:http://www.helloweba.com/view-blog-348.html 示例:http://www.helloweba.com/demo/2016/editable-select ...
- java之路径问题
1.this.class.getClassLoader().getResource("路径").getPath();路径参数不能以“/”开头,获取classes目录下文件的路径 2 ...
- spring-redis SortedSet类型成员的过期时间处理
redis默认是只支持简单key的过期处理的,像SortedSet类型,也是针对整个set的过期处理,不支持对set的某个成员的过期处理: 为了解决这个问题,做法如下: 1.存储key及值信息到red ...
- iOS开发之--storyboary下,为btn/lab/view等添加裁剪和阴影的方法
在开发过程中,很多时候我们都需要定制一个控件的属性,比如边框.阴影.圆角裁剪等,使用代码创建控件的时候,我们都知道,直接对layer图层进行各种属性的操作, self.button.layer.cor ...
- memcache的内存管理机制
Memcache使用了Slab Allocator的内存分配机制:按照预先规定的大小,将分配的内存分割成特定长度的块,以完全解决内存碎片问题Memcache的存储涉及到slab,page,chunk三 ...
- 一起学 Java集合框架、数据结构、泛型
一.Java 集合框架 集合框架是一个用来代表和操纵集合的统一架构.所有的集合框架都包含如下内容: 接口:是代表集合的抽象数据类型.接口允许集合独立操纵其代表的细节.在面向对象的语言,接口通常形成一个 ...