{"problem":{"name":"Remove One Character","description":{"content":"You are given a string $S$ of length $N$. For each $1\\leq i\\leq N$, let $S_i$ denote the string obtained by deleting the $i$\\-th character from $S$. Find the number of pairs of integers $(i,j)$ that s","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"arc130_a"},"statements":[{"statement_type":"Markdown","content":"You are given a string $S$ of length $N$. For each $1\\leq i\\leq N$, let $S_i$ denote the string obtained by deleting the $i$\\-th character from $S$.\nFind the number of pairs of integers $(i,j)$ that satisfy both of the conditions below.\n\n*   $1\\leq i < j\\leq N$\n*   $S_i = S_j$\n\n## Constraints\n\n*   $2\\leq N\\leq 3\\times 10^5$\n*   $S$ is a string of length $N$ consisting of lowercase English letters.\n\n## Input\n\nInput is given from Standard Input in the following format:\n\n$N$\n$S$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"arc130_a","tags":[],"sample_group":[["7\nabbbcca","4\n\nHere are the strings $S_i$ in order: `bbbcca`, `abbcca`, `abbcca`, `abbcca`, `abbbca`, `abbbca`, `abbbcc`.\nThe following $4$ pairs $(i,j)$ satisfy the conditions.\n\n*   $(i,j) = (2,3)$\n*   $(i,j) = (2,4)$\n*   $(i,j) = (3,4)$\n*   $(i,j) = (5,6)$"],["4\nxxxx","6"],["2\npp","1"],["2\nst","0"]],"created_at":"2026-03-03 11:01:13"}}