結果

問題 No.110 しましまピラミッド
ユーザー あかりきあかりき
提出日時 2021-02-13 12:09:15
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 1,003 bytes
コンパイル時間 340 ms
コンパイル使用メモリ 86,932 KB
実行使用メモリ 71,532 KB
最終ジャッジ日時 2023-09-27 20:31:52
合計ジャッジ時間 4,624 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 AC 69 ms
71,168 KB
testcase_03 AC 68 ms
71,152 KB
testcase_04 AC 71 ms
71,292 KB
testcase_05 AC 68 ms
71,356 KB
testcase_06 AC 67 ms
71,376 KB
testcase_07 AC 67 ms
71,376 KB
testcase_08 WA -
testcase_09 AC 69 ms
71,308 KB
testcase_10 WA -
testcase_11 AC 67 ms
71,148 KB
testcase_12 WA -
testcase_13 AC 68 ms
71,432 KB
testcase_14 AC 66 ms
71,296 KB
testcase_15 AC 66 ms
71,292 KB
testcase_16 AC 65 ms
71,380 KB
testcase_17 AC 67 ms
71,300 KB
testcase_18 AC 66 ms
71,228 KB
testcase_19 AC 65 ms
71,368 KB
testcase_20 AC 67 ms
71,152 KB
testcase_21 AC 66 ms
71,292 KB
testcase_22 AC 64 ms
71,428 KB
testcase_23 AC 67 ms
71,220 KB
testcase_24 AC 67 ms
71,432 KB
testcase_25 AC 68 ms
71,240 KB
testcase_26 AC 69 ms
71,032 KB
testcase_27 AC 67 ms
71,520 KB
testcase_28 AC 67 ms
71,384 KB
testcase_29 AC 68 ms
71,372 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:
    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
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:
    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
print(max(len(L1),len(L2)))
0