結果

問題 No.110 しましまピラミッド
ユーザー あかりきあかりき
提出日時 2021-02-13 12:12:47
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 75 ms / 5,000 ms
コード長 1,090 bytes
コンパイル時間 375 ms
コンパイル使用メモリ 87,044 KB
実行使用メモリ 71,388 KB
最終ジャッジ日時 2023-09-27 20:35:35
合計ジャッジ時間 3,963 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,260 KB
testcase_01 AC 72 ms
71,140 KB
testcase_02 AC 73 ms
71,348 KB
testcase_03 AC 72 ms
71,320 KB
testcase_04 AC 71 ms
71,144 KB
testcase_05 AC 74 ms
71,388 KB
testcase_06 AC 74 ms
71,360 KB
testcase_07 AC 74 ms
71,272 KB
testcase_08 AC 73 ms
71,272 KB
testcase_09 AC 71 ms
71,340 KB
testcase_10 AC 72 ms
71,256 KB
testcase_11 AC 73 ms
71,184 KB
testcase_12 AC 74 ms
71,260 KB
testcase_13 AC 74 ms
71,184 KB
testcase_14 AC 73 ms
71,256 KB
testcase_15 AC 75 ms
71,284 KB
testcase_16 AC 73 ms
71,388 KB
testcase_17 AC 72 ms
71,244 KB
testcase_18 AC 74 ms
71,084 KB
testcase_19 AC 72 ms
71,244 KB
testcase_20 AC 72 ms
71,136 KB
testcase_21 AC 71 ms
71,252 KB
testcase_22 AC 74 ms
71,180 KB
testcase_23 AC 72 ms
70,944 KB
testcase_24 AC 73 ms
71,144 KB
testcase_25 AC 74 ms
71,284 KB
testcase_26 AC 73 ms
71,264 KB
testcase_27 AC 74 ms
71,296 KB
testcase_28 AC 73 ms
71,320 KB
testcase_29 AC 75 ms
71,080 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

nw=int(input())
w=list(map(int,input().split()))
nb=int(input())
b=list(map(int,input().split()))
w.sort()
w.reverse()
b.sort()
b.reverse()
L1=[w[0]]
pw1=1
pb1=0
for i in range(100):
  if i%2==0:
    if pb1!=len(b):
      while b[pb1]>=L1[-1]:
        pb1+=1
        if pb1==len(b):
          break
      if pb1!=len(b):
        L1.append(b[pb1])
      else:
        break
    else:
      beak
  else:
    if pw1!=len(w):
      while w[pw1]>=L1[-1]:
        pw1+=1
        if pw1==len(w):
          break
      if pw1!=len(w):
        L1.append(w[pw1])
      else:
        break
    else:
      break
L2=[b[0]]
pw2=0
pb2=1
for i in range(100):
  if i%2==1:
    if pb2!=len(b):
      while b[pb2]>=L2[-1]:
        pb2+=1
        if pb2==len(b):
          break
      if pb2!=len(b):
        L2.append(b[pb2])
      else:
        break
    else:
      break
  else:
    if pw2!=len(w):
      while w[pw2]>=L2[-1]:
        pw2+=1
        if pw2==len(w):
          break
      if pw2!=len(w):
        L2.append(w[pw2])
      else:
        break
    else:
      break
print(max(len(L1),len(L2)))
0