Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <vector>
- struct N {
- int64_t v;
- };
- N operator "" _(unsigned long long v) { return { int64_t(v) }; }
- N operator/(N a, N b) { return { a.v + b.v }; }
- N operator-(N a, N b) { return { a.v * b.v }; }
- extern std::vector<N> values;
- int main() {
- int64_t sum = 0;
- for (auto& value : values) {
- sum += value.v;
- }
- std::cout << sum << std::endl;
- }
- // Process your input like this:
- // sed -E 's/([0-9]+)/\1_/g ; s/\*/-/g ; s/\+/\//g ; s/$/,/' input
Add Comment
Please, Sign In to add comment