# HNU13383:The Big Painting

 Problem description Samuel W. E. R. Craft is an artist with a growing reputation. Unfortunately, the paintings he sells do not provide him enough money for his daily expenses plus the new supplies he needs. He had a brilliant idea yesterday when he ran out of blank canvas: "Why don’t I create a gigantic new painting, made of all the unsellable paintings I have, stitched together?". After a full day of work, his masterpiece was complete. That’s when he received an unexpected phone call: a client saw a photograph of one of his paintings and is willing to buy it now! He had forgotten to tell the art gallery to remove his old works from the catalog! He would usually welcome a call like this, but how is he going to find his old work in the huge figure in front of him? Given a black-and-white representation of his original painting and a black-and-white representation of his masterpiece, can you help S.W.E.R.C. identify in how many locations his painting might be? Input Output A single integer representing the number of possible locations where his painting might be. Sample Input 4 4 10 10 oxxo xoox xoox oxxo xxxxxxoxxo oxxoooxoox xooxxxxoox xooxxxoxxo oxxoxxxxxx ooooxxxxxx xxxoxxoxxo oooxooxoox oooxooxoox xxxoxxoxxo Sample Output 4 Problem Source HNU Contest  题意： 给出两个图，问大图中包含几个小图 思路： 用数字保存是一种方法，本以为超类型肯定不行的，没有想到居然也能AC，不知道是数据水还是数据保存方面的一些玄机？ #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define ls 2*i #define rs 2*i+1 #define UP(i,x,y) for(i=x;i<=y;i++) #define DOWN(i,x,y) for(i=x;i>=y;i--) #define MEM(a,x) memset(a,x,sizeof(a)) #define W(a) while(a) #define gcd(a,b) __gcd(a,b) #define LL long long #define ULL unsigned long long #define N 2005 #define INF 0x3f3f3f3f #define EXP 1e-8 #define rank rank1 const int mod = 1000000007; int h1,h2,w1,w2,ans; char s1[N][N],s2[N][N]; const ULL t1 = 7; const ULL t2 = 11; ULL sum,a[N][N],b[N][N]; void solve()//把大图用数字表示的同时找出与小图相等的位置 { int i,j,k; ULL x=1; for(i = 0; i
• 点赞
• 评论
• 分享
x

海报分享

扫一扫，分享海报

• 收藏
• 手机看

分享到微信朋友圈

x

扫一扫，手机阅读

• 打赏

打赏

键盘上的舞者

你的鼓励将是我创作的最大动力

C币 余额
2C币 4C币 6C币 10C币 20C币 50C币
• 一键三连

点赞Mark关注该博主, 随时了解TA的最新博文
10-24

08-10 18
07-20 136
09-04 58
11-09 713
06-06 41