# アルゴ式: 839 SNS クエリ (2) (Swift)

## [SNS クエリ (2)](https://algo-method.com/tasks/839)

- 今回はグラフっぽい？
- どこまでがバケットなのかちゃんとわかっていないのかも
- 今回は`Set`でやったけれども、[insert](https://developer.apple.com/documentation/swift/set/3128848-insert)とか[remove](https://developer.apple.com/documentation/swift/set/1540257-remove)の計算量の記載が公式ドキュメントにない
- [removeは平均するとO(**1**)になる説](https://forums.swift.org/t/swift-set-operation-time-complexity-is-not-documented-and-where-to-report-this/44750)は見つけた
- 多分、似た理論でinsertも一緒かな？
- 実装を見て判断できるようになりたい

[editorial]: https://algo-method.com/tasks/839/editorial

### 提出

- [AC](https://algo-method.com/submissions/382418)
