結果
| 問題 |
No.110 しましまピラミッド
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2016-10-26 14:34:23 |
| 言語 | Python2 (2.7.18) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 754 bytes |
| コンパイル時間 | 42 ms |
| コンパイル使用メモリ | 6,912 KB |
| 実行使用メモリ | 6,824 KB |
| 最終ジャッジ日時 | 2024-11-24 03:50:34 |
| 合計ジャッジ時間 | 1,211 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 25 WA * 1 |
ソースコード
Nw = input()
W = sorted(list(set(map(int, raw_input().split()))))
Nb = input()
B = sorted(list(set(map(int, raw_input().split()))))
last = None
ans = 0
while len(W) > 0 and len(B) > 0:
if W[-1] == B[-1]:
W.pop()
B.pop()
ans += 1
if last == 'B':
last = 'W'
elif last == 'W':
last == 'B'
elif W[-1] > B[-1]:
W.pop()
if last == 'B' or last == None:
ans += 1
last = 'W'
else:
B.pop()
if last == 'W' or last == None:
ans += 1
last = 'B'
if len(W) > 0 and (last == 'B' or last == None):
print ans + 1
elif len(B) > 0 and (last == 'W' or last == None):
print ans + 1
else:
print ans