結果
| 問題 |
No.3067 +10 Seconds Clock
|
| コンテスト | |
| ユーザー |
lam6er
|
| 提出日時 | 2025-04-16 00:08:24 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 459 bytes |
| コンパイル時間 | 360 ms |
| コンパイル使用メモリ | 82,224 KB |
| 実行使用メモリ | 127,440 KB |
| 最終ジャッジ日時 | 2025-04-16 00:09:29 |
| 合計ジャッジ時間 | 3,225 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 WA * 2 |
| other | AC * 1 WA * 22 |
ソースコード
import sys
from collections import Counter
def main():
input = sys.stdin.read().split()
n = int(input[0])
a = list(map(int, input[1:n+1]))
counter = Counter(a)
s = n + 1
ans = 0
for x in counter:
target = s - x
if x < target:
ans += counter[x] * counter.get(target, 0)
elif x == target:
ans += counter[x] * (counter[x] - 1) // 2
print(ans)
if __name__ == "__main__":
main()
lam6er