This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <algorithm> | |
#include <fstream> | |
#include <iostream> | |
#include <ranges> | |
#include <string> | |
void part1() { | |
std::ifstream input{"input.txt"}; | |
auto view = std::ranges::istream_view<int>(input); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const std = @import("std"); | |
const assert = std.debug.assert; | |
const cache_line = std.atomic.cache_line; | |
const AtomicUsize = std.atomic.Atomic(usize); | |
const Ordering = std.atomic.Ordering; | |
const Allocator = std.mem.Allocator; | |
// A modified version of Dmitry Vyukov's bounded MPMC queue, | |
// adapted for single-consumer usage: |
OlderNewer