14 lines
712 B
C
14 lines
712 B
C
// driver.h - generated by 'usaco new' from LeetCode's metadata (edit freely).
|
|
// Reads subarrays-distinct-element-sum-of-squares-ii.in in LeetCode's testcase format, cases back to back:
|
|
// one argument per line
|
|
// and writes one answer per case to subarrays-distinct-element-sum-of-squares-ii.out, formatted the way LeetCode
|
|
// shows its output. Parsing/printing helpers: leetcode.h.
|
|
int main() {
|
|
freopen("subarrays-distinct-element-sum-of-squares-ii.in", "r", stdin);
|
|
freopen("subarrays-distinct-element-sum-of-squares-ii.out", "w", stdout);
|
|
for (vector<string> in; lc::read_case(in, 1);) {
|
|
auto nums = lc::parse<vector<int>>(in[0]);
|
|
cout << lc::show(Solution().sumCounts(nums)) << '\n';
|
|
}
|
|
}
|