結果

問題 No.1225 I hate I hate Matrix Construction
ユーザー ああいいああいい
提出日時 2022-05-13 19:57:55
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 675 bytes
コンパイル時間 1,539 ms
コンパイル使用メモリ 86,828 KB
実行使用メモリ 76,488 KB
最終ジャッジ日時 2023-09-29 04:24:50
合計ジャッジ時間 4,986 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
71,388 KB
testcase_01 AC 73 ms
71,240 KB
testcase_02 AC 72 ms
71,268 KB
testcase_03 AC 76 ms
75,720 KB
testcase_04 AC 81 ms
76,004 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 81 ms
75,920 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 82 ms
76,488 KB
testcase_11 AC 81 ms
76,376 KB
testcase_12 WA -
testcase_13 AC 80 ms
75,832 KB
testcase_14 AC 79 ms
75,792 KB
testcase_15 AC 80 ms
76,424 KB
testcase_16 AC 81 ms
76,176 KB
testcase_17 AC 81 ms
76,084 KB
testcase_18 AC 86 ms
76,188 KB
testcase_19 AC 82 ms
76,284 KB
testcase_20 AC 82 ms
76,224 KB
testcase_21 AC 83 ms
76,036 KB
testcase_22 AC 86 ms
76,028 KB
testcase_23 AC 82 ms
76,168 KB
testcase_24 AC 80 ms
76,308 KB
testcase_25 AC 81 ms
75,980 KB
testcase_26 AC 78 ms
76,428 KB
testcase_27 AC 72 ms
71,328 KB
testcase_28 AC 85 ms
76,128 KB
testcase_29 AC 81 ms
76,364 KB
testcase_30 AC 84 ms
76,240 KB
testcase_31 AC 87 ms
76,024 KB
testcase_32 AC 86 ms
76,160 KB
testcase_33 AC 83 ms
76,280 KB
testcase_34 AC 86 ms
76,260 KB
testcase_35 AC 86 ms
76,344 KB
testcase_36 AC 82 ms
76,372 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
S = list(map(int,input().split()))
T = list(map(int,input().split()))

yoko = 0
tate = 0
ans = 0
dat = [[-1] * N for _ in range(N)]
sflag = False
tflag = False
for i in range(N):
    for j in range(N):
        if S[i] == 0 or T[j] == 0:
            dat[i][j] = 0
        elif S[i] == 2 or T[j] == 2:
            ans += 1
            dat[i][j] = 1
for s in S:
    if s == 1:
        yoko += 1
    elif s == 2:
        sflag = True
for t in T:
    if t == 1:
        tate += 1
    elif t == 2:
        tflag = True
        
if sflag and tflag:
    pass
elif not sflag:
    ans += tate
elif not tflag:
    ans += yoko
else:
    ans += max(yoko,tate)
print(ans)
0