結果
| 問題 | No.1225 I hate I hate Matrix Construction |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-09-11 22:33:16 |
| 言語 | PyPy3 (8.0.0 + ACL) |
| 結果 |
WA
不安定
|
| 実行時間 | - |
| コード長 | 664 bytes |
| 記録 | |
| コンパイル時間 | 62 ms |
| コンパイル使用メモリ | 82,112 KB |
| 実行使用メモリ | 66,148 KB |
| 最終ジャッジ日時 | 2026-10-08 16:18:13 |
| 合計ジャッジ時間 | 3,382 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 31 WA * 4 |
ソースコード
n = int(input())
s = list(map(int, input().split()))
t = list(map(int, input().split()))
row = [0] * n
col = [0] * n
ans = 0
for i in range(n):
if s[i] == 2:
for j in range(n):
ans += 1
col[j] += 1
if t[i] == 2:
for j in range(n):
ans += 1
row[j] += 1
for i in range(n):
for j in range(n):
if s[i] == 1 and t[j] == 1:
if row[i] == 0 and col[j] == 0:
ans += 1
row[i] += 1
col[j] += 1
for i in range(n):
if s[i] == 1 and row[i] == 0:
ans += 1
if t[i] == 1 and col[i] == 0:
ans += 1
print(ans)