Solutions to AtCoder ABC 066
Problem A - Sum of Two Smallest Numbers
Statement:
Given three integers, output the sum of the two smallest values.
Solution:
Subtract the maximum value from the total sum.
int a, b, c; cin >> a >> b >> c;
cout << a + b + c - max({a, b, c}) << endl;
Problem B - Finding the Longest Even Prefix
Statement:
A string i ...
Posted on Sun, 10 May 2026 03:20:54 +0000 by mynameisbob
Understanding STL Container Adapters: stack and queue
The essence of a container adapter lies in the principle of reuse. Instead of implementing storage structures from scratch, these adapters leverage existing containers to handle data storage while exposing only the interfaces relevant to their specific access patterns. This adapter pattern represents a fundamental design philosophy in software ...
Posted on Sat, 09 May 2026 06:42:40 +0000 by mgilbert
Algorithmic Patterns with Stacks, Monotonic Deques, and Priority Queues in C++
Evaluating Reverse Polish Notation
Reverse Polish Notation (RPN) eliminates the need for parentheses by placing operators after their operands. A stack-based approach efficiently processes tokens in a single pass.
class Solution {
public:
int evalRPN(vector<string>& expr) {
stack<int> eval_stack;
for (const a ...
Posted on Sat, 09 May 2026 00:38:32 +0000 by tazgalsinh