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 ...
随机推荐
- 布局溢出屏幕解决-easyui
body样式easyui-layout 再加个滚轮
- <! - - ... - -> 注解
<A HREF TARGET> 指定超连结的分割视窗 <A HREF=#锚的名称> 指定锚名称的超连结 <A HREF> 指定超连结 <A NAME=锚的名称 ...
- redhat ent6.5使用centos yum
转载自:http://blog.csdn.net/zhngjan/article/details/20843465 搜狐镜像库:mirrors.sohu.com 163镜像库:mirrors.163. ...
- python数据表的合并(python pandas join() 、merge()和concat()的用法)
merage# pandas提供了一个类似于关系数据库的连接(join)操作的方法<Strong>merage</Strong>,可以根据一个或多个键将不同DataFrame中 ...
- android 性能測试CTS篇
CTS介绍 一.CTS简单介绍 CTS 全称Compatibility Test Suite兼容性測试工具. 当电子产品开发出来.并定制了自己的Android系统后,必需要通过最新的CTS检測.以保证 ...
- 将BT转为磁力链接
实战代码 安装完成后,我们来看下代码: 系统环境:Linux Python环境:Python2.7 请注意python版本 bt2url.py 1 2 3 4 5 6 7 8 9 10 11 12 1 ...
- c++ 类初始化
一. 成员初始化列表的位置. 成员初始化列表的位置位于构造函数的函数体和参数表之间.构造函数初始化列表以一个冒号开始,接着是以逗号分隔的数据成员列表,每个数据成员后面跟一个放在括号中的初始化式,初始化 ...
- less.js
在引入你自己的less文件的时候 <link rel="stylesheet/less" href="styles/site.less"> 之后再引 ...
- 爬虫实战【13】获取自己的动态代理ip池
在爬取一些比较友好的网站时,仍然有可能因为单位时间内访问次数过多,使服务器认定为机器访问,导致访问失败或者被封.如果我们使用不同的ip来访问网站的话,就可以绕过服务器的重复验证,使服务器以为使不同的人 ...
- angualar入门学习-- 自定义指令 指令编译执行过程
3个阶段: 一.加载阶段 加载angular.js的源码,找到ng-app确定应用边界范围. 二.编译阶段 compile 查找所有指令,保存在一个列表中 对所有指令按优先级(property属性值) ...