結果
問題 |
No.110 しましまピラミッド
|
ユーザー |
|
提出日時 | 2016-04-24 11:54:33 |
言語 | Python2 (2.7.18) |
結果 |
AC
|
実行時間 | 11 ms / 5,000 ms |
コード長 | 521 bytes |
コンパイル時間 | 235 ms |
コンパイル使用メモリ | 7,040 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-12-31 11:19:26 |
合計ジャッジ時間 | 1,295 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 26 |
ソースコード
# coding: utf-8 #yuki_110 def solve(l1,l2): res=0 i=21 F=False while i>0: if l1[i] and not F: res+=1 F=True elif l2[i] and F: res+=1 F=False i-=1 return res nw=int(raw_input()) lmw=list(map(int, raw_input().split())) nb=int(raw_input()) lmb=list(map(int, raw_input().split())) w=list(set(lmw)) b=list(set(lmb)) lw=[0 for i in xrange(22)] lb=[0 for i in xrange(22)] for i in xrange(len(w)): lw[w[i]]=1 for i in xrange(len(b)): lb[b[i]]=1 res=max(solve(lw,lb),solve(lb,lw)) print res