結果

問題 No.190 Dry Wet Moist
ユーザー n_knuun_knuu
提出日時 2015-04-22 01:35:00
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 318 ms / 2,000 ms
コード長 364 bytes
コンパイル時間 72 ms
コンパイル使用メモリ 10,676 KB
実行使用メモリ 31,060 KB
最終ジャッジ日時 2023-09-18 07:36:35
合計ジャッジ時間 4,638 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,816 KB
testcase_01 AC 14 ms
7,736 KB
testcase_02 AC 14 ms
7,720 KB
testcase_03 AC 16 ms
7,788 KB
testcase_04 AC 16 ms
7,724 KB
testcase_05 AC 15 ms
7,760 KB
testcase_06 AC 15 ms
7,800 KB
testcase_07 AC 17 ms
8,220 KB
testcase_08 AC 16 ms
8,180 KB
testcase_09 AC 15 ms
7,752 KB
testcase_10 AC 16 ms
7,704 KB
testcase_11 AC 15 ms
7,732 KB
testcase_12 AC 167 ms
17,492 KB
testcase_13 AC 211 ms
19,604 KB
testcase_14 AC 166 ms
17,000 KB
testcase_15 AC 223 ms
20,608 KB
testcase_16 AC 300 ms
24,224 KB
testcase_17 AC 48 ms
9,884 KB
testcase_18 AC 139 ms
15,120 KB
testcase_19 AC 279 ms
24,060 KB
testcase_20 AC 193 ms
18,916 KB
testcase_21 AC 37 ms
9,224 KB
testcase_22 AC 226 ms
30,920 KB
testcase_23 AC 318 ms
31,060 KB
testcase_24 AC 238 ms
29,832 KB
testcase_25 AC 15 ms
7,796 KB
testcase_26 AC 15 ms
7,660 KB
testcase_27 AC 215 ms
22,832 KB
testcase_28 AC 108 ms
14,632 KB
testcase_29 AC 139 ms
15,764 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,A=int(input()),list(map(int,input().split()));l,r,m=0,2*N-1,A.count(0)//2;A.sort()
while l<r and A[l]<0 and A[r]>0:
    if abs(A[l])==A[r]:m+=1;l+=1;r-=1
    elif abs(A[l])>A[r]:l+=1
    else:r-=1
l,r,w=0,2*N-1,0
while l<r:
    if A[l]+A[r]<=0:l+=1
    else:w+=1;l+=1;r-= 1
l,r,d=0,2*N-1,0
while l<r:
    if A[l]+A[r]>=0:r-=1
    else:d+=1;l+=1;r-=1
print(d,w,m)
0