結果

問題 No.190 Dry Wet Moist
ユーザー pluto77pluto77
提出日時 2016-09-14 11:50:04
言語 Python2
(2.7.18)
結果
AC  
実行時間 342 ms / 2,000 ms
コード長 379 bytes
コンパイル時間 416 ms
コンパイル使用メモリ 6,500 KB
実行使用メモリ 23,244 KB
最終ジャッジ日時 2023-08-10 20:28:56
合計ジャッジ時間 6,299 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 10 ms
5,916 KB
testcase_01 AC 11 ms
5,868 KB
testcase_02 AC 11 ms
5,844 KB
testcase_03 AC 11 ms
5,840 KB
testcase_04 AC 10 ms
5,996 KB
testcase_05 AC 11 ms
5,920 KB
testcase_06 AC 11 ms
5,948 KB
testcase_07 AC 13 ms
6,032 KB
testcase_08 AC 12 ms
5,984 KB
testcase_09 AC 11 ms
5,872 KB
testcase_10 AC 11 ms
5,940 KB
testcase_11 AC 12 ms
5,936 KB
testcase_12 AC 162 ms
12,780 KB
testcase_13 AC 198 ms
14,648 KB
testcase_14 AC 153 ms
12,588 KB
testcase_15 AC 215 ms
15,388 KB
testcase_16 AC 274 ms
17,968 KB
testcase_17 AC 42 ms
7,280 KB
testcase_18 AC 131 ms
11,280 KB
testcase_19 AC 272 ms
17,828 KB
testcase_20 AC 187 ms
14,096 KB
testcase_21 AC 31 ms
6,864 KB
testcase_22 AC 341 ms
23,156 KB
testcase_23 AC 285 ms
23,244 KB
testcase_24 AC 342 ms
23,040 KB
testcase_25 AC 11 ms
5,988 KB
testcase_26 AC 11 ms
5,924 KB
testcase_27 AC 192 ms
16,912 KB
testcase_28 AC 90 ms
10,616 KB
testcase_29 AC 113 ms
12,112 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