{"version":"1.0","width":"100%","height":"190","title":"TopCoder SRM592: LittleElephantAndBalls","blog_title":"C\u266f\u306e\u52c9\u5f37","blog_url":"https://emkcsharp.hatenablog.com/","author_url":"https://blog.hatena.ne.jp/EmK/","published":"2013-10-01 22:36:44","categories":["TopCoder","Div1","Div1Easy"],"author_name":"EmK","type":"rich","provider_name":"Hatena Blog","image_url":null,"provider_url":"https://hatena.blog","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Femkcsharp.hatenablog.com%2Fentry%2FSRM592%2FLittleElephantAndBalls\" title=\"TopCoder SRM592: LittleElephantAndBalls - C\u266f\u306e\u52c9\u5f37\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","url":"https://emkcsharp.hatenablog.com/entry/SRM592/LittleElephantAndBalls","description":"\u9752\u8d64 \u9752\u7dd1 \u2190\u2190 \u2192\u2192 \u2191 \u2191 \u4e0a\u306e\u56f3\u306e\u3088\u3046\u306b\u3001\u5de6\u53f3\u306e\u30ad\u30e5\u30fc\u306e\u3069\u3061\u3089\u304b\u306b\u8ffd\u52a0\u3057\u3066\u3044\u304f\u3002\u3053\u306e\u3068\u304d\u306b\u3059\u3067\u306b\u305d\u306e\u8272\u304c\u5165\u3063\u3066\u306a\u3044\u30ad\u30e5\u30fc\u306b\u5165\u308c\u308b\u3088\u3046\u306b\u3059\u308c\u3070\u3088\u3044\u3002 public class LittleElephantAndBalls { public int getNumber(string S) { var left = new HashSet(); var right = new HashSet(); int ans = 0; foreach (var c in S) { ans += left.Count() + right.Count(); if (!left.Con\u2026"}