結果
問題 |
No.110 しましまピラミッド
|
ユーザー |
![]() |
提出日時 | 2015-10-12 17:06:57 |
言語 | Python2 (2.7.18) |
結果 |
AC
|
実行時間 | 11 ms / 5,000 ms |
コード長 | 418 bytes |
コンパイル時間 | 67 ms |
コンパイル使用メモリ | 7,040 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-12-31 11:12:41 |
合計ジャッジ時間 | 1,381 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 26 |
ソースコード
def solve(A,pos_a,B,pos_b): ans = 0 tmp = 21 while 1: while A[pos_a] >= tmp: pos_a -= 1 if pos_a < 0: return ans ans += 1 tmp = A[pos_a] while B[pos_b] >= tmp: pos_b -= 1 if pos_b < 0: return ans ans += 1 tmp = B[pos_b] Nw = input() W = map(int,raw_input().split()) Nb = input() B = map(int,raw_input().split()) W.sort() B.sort() print max(solve(W,Nw-1,B,Nb-1),solve(B,Nb-1,W,Nw-1))