結果
問題 |
No.3067 +10 Seconds Clock
|
ユーザー |
![]() |
提出日時 | 2025-04-16 16:23:46 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 459 bytes |
コンパイル時間 | 339 ms |
コンパイル使用メモリ | 81,820 KB |
実行使用メモリ | 127,376 KB |
最終ジャッジ日時 | 2025-04-16 16:24:30 |
合計ジャッジ時間 | 2,879 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
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()