結果
| 問題 |
No.1225 I hate I hate Matrix Construction
|
| コンテスト | |
| ユーザー |
neterukun
|
| 提出日時 | 2020-09-11 22:08:03 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 671 bytes |
| コンパイル時間 | 270 ms |
| コンパイル使用メモリ | 82,176 KB |
| 実行使用メモリ | 63,488 KB |
| 最終ジャッジ日時 | 2024-12-27 13:12:11 |
| 合計ジャッジ時間 | 3,390 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 29 WA * 6 |
ソースコード
n = int(input())
s = list(map(int, input().split()))
t = list(map(int, input().split()))
a = [[-1] * n for i in range(n)]
for i in range(n):
if s[i] == 0:
for j in range(n):
a[i][j] = 0
if s[i] == 2:
for j in range(n):
a[i][j] = 1
if t[i] == 0:
for j in range(n):
a[j][i] = 0
if t[i] == 2:
for j in range(n):
a[j][i] = 1
cnt1 = 0
for i in range(n):
for j in range(n):
if a[i][j] == 1:
cnt1 += 1
if 2 in s and 2 in t:
print(cnt1)
elif 0 in s and 0 in t:
print(max(s.count(1), t.count(1)))
else:
print(cnt1 + min(s.count(1), t.count(1)))
neterukun