結果
問題 | No.82 市松模様 |
ユーザー |
![]() |
提出日時 | 2016-03-23 14:52:09 |
言語 | Python2 (2.7.18) |
結果 |
AC
|
実行時間 | 11 ms / 5,000 ms |
コード長 | 563 bytes |
コンパイル時間 | 260 ms |
コンパイル使用メモリ | 7,040 KB |
実行使用メモリ | 6,272 KB |
最終ジャッジ日時 | 2024-10-01 21:26:35 |
合計ジャッジ時間 | 1,020 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 7 |
ソースコード
#coding:utf-8s=raw_input().split()w=int(s[0])h=int(s[1])h1=hn=s[2]h_even=''h_odd=''while h:if h%2==1:for i in range(w):if i%2==0:h_even+=nelse:if n=='B':h_even+='W'else:h_even+='B'else:for i in range(w):if i%2==1:h_odd+=nelse:if n=='B':h_odd+='W'else:h_odd+='B'h-=1h_even=list(h_even)h_odd=list(h_odd)res=[]for i in range(h1):if i%2==0:res.append(h_even[:w])del h_even[:w]else:res.append(h_odd[:w])del h_odd[:w]for i in res:print ''.join(i)