Submission #1008180

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
10081802024-06-26 08:11:28jakobrsGame (IOI13_game)C++17
37 / 100
13042 ms89104 KiB
#include "game.h"
#include <iostream>
#include <numeric>
#include <vector>
using i32 = int32_t;
using i64 = long long;
auto midpoint(i32 l, i32 r) -> i32 { return l + (r - l) / 2; }
struct Node {
Node *l, *r;
i32 from, to;
i64 val;
explicit Node(i32 from, i32 to)
: l{nullptr}, r{nullptr}, from{from}, to{to}, val{0} {}
explicit Node(i32 len) : Node(0, len) {}
auto left() -> Node * { return l ?: l = new Node(from, midpoint(from, to)); }
auto right() -> Node * { return r ?: r = new Node(midpoint(from, to), to); }
void set(i32 pos, i64 i) {
if (to - from > 1) {
auto m = midpoint(from, to);
if (pos < m)
left()->set(pos, i);
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...