結果

問題 No.190 Dry Wet Moist
ユーザー roiti46roiti46
提出日時 2015-10-11 05:14:07
言語 Python2
(2.7.18)
結果
AC  
実行時間 408 ms / 2,000 ms
コード長 608 bytes
コンパイル時間 330 ms
コンパイル使用メモリ 6,608 KB
実行使用メモリ 25,160 KB
最終ジャッジ日時 2023-09-28 11:38:10
合計ジャッジ時間 7,026 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 24 ms
7,816 KB
testcase_01 AC 25 ms
7,856 KB
testcase_02 AC 24 ms
7,800 KB
testcase_03 AC 24 ms
7,876 KB
testcase_04 AC 24 ms
7,724 KB
testcase_05 AC 24 ms
7,832 KB
testcase_06 AC 23 ms
7,732 KB
testcase_07 AC 26 ms
7,928 KB
testcase_08 AC 25 ms
7,816 KB
testcase_09 AC 24 ms
7,876 KB
testcase_10 AC 24 ms
7,704 KB
testcase_11 AC 25 ms
7,772 KB
testcase_12 AC 189 ms
14,456 KB
testcase_13 AC 235 ms
16,412 KB
testcase_14 AC 182 ms
14,328 KB
testcase_15 AC 256 ms
17,016 KB
testcase_16 AC 329 ms
19,892 KB
testcase_17 AC 57 ms
9,072 KB
testcase_18 AC 153 ms
13,152 KB
testcase_19 AC 316 ms
19,624 KB
testcase_20 AC 217 ms
15,764 KB
testcase_21 AC 45 ms
8,676 KB
testcase_22 AC 397 ms
25,144 KB
testcase_23 AC 363 ms
25,160 KB
testcase_24 AC 408 ms
25,064 KB
testcase_25 AC 24 ms
7,780 KB
testcase_26 AC 24 ms
7,816 KB
testcase_27 AC 237 ms
18,736 KB
testcase_28 AC 112 ms
12,324 KB
testcase_29 AC 138 ms
13,812 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# -*- coding: utf-8 -*-
import sys,copy,math,heapq,itertools as it,fractions,re,bisect,collections as coll

N = int(raw_input())
A = map(int, raw_input().split())
A.sort()
B = A[::-1]

dry = wet = moist = 0
i = j = 0
while i + j < 2 * N - 1:
    if A[i] + B[j] < 0:
        i += 1
        dry += 1
    j += 1
i = j = 0
while i + j < 2 * N - 1:
    if A[i] + B[j] > 0:
        j += 1
        wet += 1
    i += 1
i = j = 0
while i + j < 2 * N - 1:
    if A[i] + B[j] == 0:
        i += 1
        j += 1
        moist += 1
    elif A[i] + B[j] < 0:
        i += 1
    else:
        j += 1
print dry, wet, moist
0