結果

問題 No.2779 Don't make Pair
ユーザー _a_a
提出日時 2024-06-07 22:54:12
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 1,864 bytes
コンパイル時間 89 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 26,016 KB
最終ジャッジ日時 2024-06-07 22:54:20
合計ジャッジ時間 4,764 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 34 ms
16,896 KB
testcase_01 AC 32 ms
11,648 KB
testcase_02 WA -
testcase_03 AC 34 ms
11,776 KB
testcase_04 AC 31 ms
11,648 KB
testcase_05 AC 31 ms
11,648 KB
testcase_06 WA -
testcase_07 AC 30 ms
11,648 KB
testcase_08 AC 31 ms
11,520 KB
testcase_09 AC 64 ms
13,056 KB
testcase_10 AC 226 ms
20,992 KB
testcase_11 AC 101 ms
14,464 KB
testcase_12 TLE -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

import os, sys
import math, decimal, queue, heapq, bisect, itertools, functools, collections, string
from bisect import bisect, bisect_left
from collections import defaultdict, OrderedDict, deque, Counter
from functools import cmp_to_key, lru_cache, reduce
from heapq import heapify, heappush, heappushpop, heappop, heapreplace, nlargest, nsmallest
from itertools import accumulate, chain, combinations, combinations_with_replacement, compress, count, cycle, dropwhile, filterfalse, groupby, islice, permutations, product, repeat, starmap, takewhile, tee, zip_longest
from math import gcd, factorial, isqrt, comb, perm, prod, inf
from queue import Queue, PriorityQueue, LifoQueue
from string import ascii_letters, ascii_lowercase, ascii_uppercase, digits, hexdigits, octdigits

LOCAL = sys.argv[0] if '4a' in sys.argv[0] else None

P = lambda *p: [print(i, end='	') for i in p] if LOCAL else None
PI = lambda *p: print(' '.join(map(str, p))) or None
PII = lambda X: [PI(*row) for row in X]

sys.stdin = open(os.path.join(os.getcwd(), 'a1.txt'), 'r') if LOCAL else sys.stdin
I = lambda: [int(a) for l in sys.stdin for a in l.strip().split()]
S = lambda: [a for l in sys.stdin for a in l.strip().split()]
IM = lambda: [[int(a) for a in l.split()] for l in sys.stdin]
SM = lambda: [[a for a in l.split()] for l in sys.stdin]

az, AZ, mod = ascii_lowercase, ascii_uppercase, 1_000_000_007

A = IM()
# P(A)


def solution(A):
    N = A[0][0]
    B = A[1]
    # P(N, B)
    l, r = set(), set()
    out = 0
    res = []
    c = Counter()
    d = Counter(B)
    for i, num in enumerate(B):
        # P(c, d, '\n')
        c[num] += 1
        d[num] -= 1
        x = c.most_common()[0][1]
        y = d.most_common()[0][1]
        # P(x, y, c, d, '\n')
        if x <= 1 and y <= 1:
            out += 1
            res += [i + 1]
    print(out)
    PI(*res)


solution(A)
0