题目 › egoi26-wateringplants

Watering Plants

EGOI 2026 · 2026-05 · L3 困难 · C++17 · 时限 2 秒 · 子任务取最低分

查看原题跳到结果

题面

来源:EGOI 2026 官方 PDF。模型收到的是由同一份 Typst 源文件转换的文字。

EGOI 2026 Watering Plants 官方题面第 1 页EGOI 2026 Watering Plants 官方题面第 2 页EGOI 2026 Watering Plants 官方题面第 3 页

结果

Kimi K3.1 ProKimi

auto(max)

3/3

解出的采样 ↑

  • 100采样 1 · 解出
  • 100采样 2 · 解出
  • 100采样 3 · 解出
  • 2.3k平均输出 token(含思考) ↓
  • 29.5输出速度 tokens/s ↑
  • 75 秒延迟 ↓

DeepSeek Flash V4.1-1017DeepSeek

auto(high)

3/3

解出的采样 ↑

  • 100采样 1 · 解出
  • 100采样 2 · 解出
  • 100采样 3 · 解出
  • 6.1k平均输出 token(含思考) ↓
  • 211.8输出速度 tokens/s ↑
  • 30 秒延迟 ↓

MiniMax M3.1 FlashMiniMax

auto(max)

3/3

解出的采样 ↑

  • 100采样 1 · 解出
  • 100采样 2 · 解出
  • 100采样 3 · 解出
  • 17.0k平均输出 token(含思考) ↓
  • 93.6输出速度 tokens/s ↑
  • 179 秒延迟 ↓

↑ 越大越好,↓ 越小越好。得分 0–100,按官方时限判定,所有测试点都满分才算解出。CPU 时间 / 官方解为解出的答案在官方解最慢的 3 个测试点上的 CPU 时间之比(几何平均),只比较官方解至少需要 0.05 秒的题;复杂度按增长幂次相对官方解分类。判题与计分见 原理。

代码

Kimi K3.1 Pro · 采样 1 · 65 行
#include <bits/stdc++.h>
using namespace std;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    int N, D;
    cin >> N >> D;

    vector<long long> t(N);
    for (int i = 0; i < N; ++i) {
        cin >> t[i];
    }

    // Edge r represents resident r watering resident r - 1.
    vector<long long> count(N, 0), lastSync(N, 0);
    vector<bool> active(N, false);

    for (int r = 1; r < N; ++r) {
        active[r] = t[r] < t[r - 1];
    }

    auto sync = [&](int r, int daysElapsed) {
        if (active[r]) {
            count[r] += daysElapsed - lastSync[r];
        }
        lastSync[r] = daysElapsed;
    };

    for (int day = 0; day < D; ++day) {
        char type;
        cin >> type;
        int daysElapsed = day + 1;

        if (type == '?') {
            int r;
            cin >> r;
            sync(r, daysElapsed);
            cout << count[r] << '\n';
        } else {
            int r;
            long long x;
            cin >> r >> x;

            // Finalize the affected edges using the old schedule.
            for (int e = r; e <= r + 1; ++e) {
                if (e >= 1 && e < N) {
                    sync(e, daysElapsed);
                }
            }

            t[r] = x;

            // The new schedule takes effect from the next day.
            for (int e = r; e <= r + 1; ++e) {
                if (e >= 1 && e < N) {
                    active[e] = t[e] < t[e - 1];
                }
            }
        }
    }

    return 0;
}