結果
問題 |
No.1225 I hate I hate Matrix Construction
|
ユーザー |
👑 ![]() |
提出日時 | 2020-09-11 21:38:32 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,002 bytes |
コンパイル時間 | 833 ms |
コンパイル使用メモリ | 81,920 KB |
実行使用メモリ | 54,016 KB |
最終ジャッジ日時 | 2024-12-27 07:16:47 |
合計ジャッジ時間 | 3,054 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 29 WA * 6 |
ソースコード
""" 論理積が0が抜けてる →1つ以上0 論理和0→全部0 論理和1→1つ1 論理積1→全部1 全0を含んでいる場合、 全1を含んでいる場合 """ N = int(input()) S = list(map(int,input().split())) T = list(map(int,input().split())) a = [[None] * N for i in range(N)] if 0 in S and 2 in S: ans = 0 for i in S: if i == 1: ans += 1 elif i == 2: ans += N print (ans) elif 0 in T and 2 in T: ans = 0 for i in T: if i == 1: ans += 1 elif i == 2: ans += N print (ans) elif 0 in S or 0 in T: tx = 0 ty = 0 for i in S: if i == 1: tx += 1 for i in T: if i == 1: ty += 1 print (max(tx,ty)) elif 2 in S or 2 in T: tx = 0 ty = 0 for i in S: if i == 2: tx += 1 for i in T: if i == 2: ty += 1 print (tx * N + ty * N - tx * ty) else: print (N)