设为首页 加入收藏

TOP

Codeforces Round #290 (Div. 2)(A,B,C)(一)
2015-07-24 05:04:25 来源: 作者: 【 】 浏览:18
Tags:Codeforces Round #290 Div.

A. Fox And Snake time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output

Fox Ciel starts to learn programming. The first task is drawing a fox! However, that turns out to be too hard for a beginner, so she decides to draw a snake instead.

A snake is a pattern on a n by m table. Denote c-th cell of r-th row as (r,?c). The tail of the snake is located at (1,?1), then it's body extends to (1,?m), then goes down 2 rows to (3,?m), then goes left to (3,?1) and so on.

Your task is to draw this snake for Fox Ciel: the empty cells should be represented as dot characters ('.') and the snake cells should be filled with number signs ('#').

Consider sample tests in order to understand the snake pattern.

Input

The only line contains two integers: n and m (3?≤?n,?m?≤?50).

n is an odd number.

Output

Output n lines. Each line should contain a string consisting of m characters. Do not output spaces.

Sample test(s) input
3 3
output
###
..#
###
input
3 4
output
####
...#
####
input
5 3
output
###
..#
###
#..
###
input
9 9
output
#########
........#
#########
#........
#########
........#
#########
#........
#########

include 
  
   
#include 
   
     #include 
    
      #include 
     
       #include 
      
        #include 
       
         #include 
         #include 
         
           using namespace std; const int inf=0x3f3f3f3f; int main() { int n,m,i,j; while(~scanf("%d %d",&n,&m)) { for(i=1; i<=n; i++) { if(i%2==1) { for(j=1; j<=m; j++) printf("#"); printf("\n"); } else { if(i%2==0&&i%4==0) { printf("#"); for(j=2; j<=m; j++) printf("."); printf("\n"); } else if(i%2==0&&i%4!=0) { for(j=1; j
          
            B. Fox And Two Dots time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output 
           

Fox Ciel is playing a mobile puzzle game called "Two Dots". The basic levels are played on a board of size n?×?m cells, like this:

\

Each cell contains a dot that has some colZ??http://www.2cto.com/kf/ware/vc/" target="_blank" class="keylink">vci4gV2Ugd2lsbCB1c2UgZGlmZmVyZW50IHVwcGVyY2FzZSBMYXRpbiBjaGFyYWN0ZXJzIHRvIGV4cHJlc3MgZGlmZmVyZW50IGNvbG9ycy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mUgaWYgdGhlcmUgZXhpc3RzIGEgY3ljbGUgb24gdGhlIGZpZWxkLjwvcD4KCgoKSW5wdXQKPHA+ClRoZSBmaXJzdCBsaW5lIGNvbnRhaW5zIHR3byBpbnRlZ2VycyA8ZW0+bjwvZW0+IGFuZCA8ZW0+bTwvZW0+ICgyP6HcPzxlbT5uPC9lbT4sPzxlbT5tPC9lbT4/odw/NTApOgogdGhlIG51bWJlciBvZiByb3dzIGFuZCBjb2x1bW5zIG9mIHRoZSBib2FyZC48L3A+CjxwPgpUaGVuIDxlbT5uPC9lbT4gbGluZXMgZm9sbG93LCBlYWNoIGxpbmUgY29udGFpbnMgYSBzdHJ

首页 上一页 1 2 3 下一页 尾页 1/3/3
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇c++ const成员函数的纠结 下一篇BZOJ 3503 CQOI 2014 和谐矩阵 高..

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容: