結果
問題 | No.110 しましまピラミッド |
ユーザー |
|
提出日時 | 2016-04-24 11:03:04 |
言語 | Python2 (2.7.18) |
結果 |
AC
|
実行時間 | 13 ms / 5,000 ms |
コード長 | 563 bytes |
コンパイル時間 | 228 ms |
コンパイル使用メモリ | 7,040 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-12-31 11:18:52 |
合計ジャッジ時間 | 1,575 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
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)) w.sort() w.reverse() b.sort() b.reverse() 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