結果

問題 No.190 Dry Wet Moist
ユーザー pluto77pluto77
提出日時 2016-09-14 11:50:04
言語 Python2
(2.7.18)
結果
AC  
実行時間 317 ms / 2,000 ms
コード長 379 bytes
コンパイル時間 273 ms
コンパイル使用メモリ 6,912 KB
実行使用メモリ 23,736 KB
最終ジャッジ日時 2024-04-28 13:41:47
合計ジャッジ時間 5,021 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 9 ms
6,816 KB
testcase_01 AC 8 ms
6,940 KB
testcase_02 AC 10 ms
6,940 KB
testcase_03 AC 9 ms
6,940 KB
testcase_04 AC 10 ms
6,940 KB
testcase_05 AC 9 ms
6,940 KB
testcase_06 AC 9 ms
6,948 KB
testcase_07 AC 11 ms
6,940 KB
testcase_08 AC 11 ms
6,940 KB
testcase_09 AC 11 ms
6,944 KB
testcase_10 AC 10 ms
6,944 KB
testcase_11 AC 9 ms
6,940 KB
testcase_12 AC 149 ms
13,192 KB
testcase_13 AC 187 ms
15,088 KB
testcase_14 AC 140 ms
12,900 KB
testcase_15 AC 196 ms
15,824 KB
testcase_16 AC 249 ms
18,396 KB
testcase_17 AC 38 ms
7,552 KB
testcase_18 AC 116 ms
11,784 KB
testcase_19 AC 253 ms
18,132 KB
testcase_20 AC 173 ms
14,464 KB
testcase_21 AC 28 ms
7,296 KB
testcase_22 AC 317 ms
23,608 KB
testcase_23 AC 251 ms
23,736 KB
testcase_24 AC 305 ms
23,608 KB
testcase_25 AC 10 ms
6,940 KB
testcase_26 AC 9 ms
6,940 KB
testcase_27 AC 180 ms
17,040 KB
testcase_28 AC 87 ms
10,884 KB
testcase_29 AC 110 ms
12,428 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#yuki_190

n=int(raw_input())
a=map(int,raw_input().split())
a.sort()
dry=wet=moist=0
l=0
r=2*n-1
while l<r:
 if a[l]+a[r]<0:
  dry+=1
  l+=1
  r-=1
 else:
  r-=1
l=0
r=2*n-1
while l<r:
 if a[l]+a[r]>0:
  wet+=1
  l+=1
  r-=1
 else:
  l+=1
l=0
r=2*n-1
while l<r:
 if a[l]+a[r]==0:
  moist+=1
  l+=1
  r-=1
 elif abs(a[l])-abs(a[r])<0:
  r-=1
 else:
  l+=1
  
print dry,wet,moist
0