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



结果
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; }
Kimi K3.1 Pro · 采样 2 · 48 行
#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 (long long &x : t) cin >> x; // Edge r represents resident r watering resident r-1. // last[r] is the last day for which edge r has been accounted for. vector<int> last(N, -1); vector<long long> watered(N, 0); auto sync = [&](int r, int day) { long long days = day - last[r]; if (t[r] < t[r - 1]) watered[r] += days; last[r] = day; }; for (int day = 0; day < D; ++day) { char type; cin >> type; if (type == '!') { int r; long long x; cin >> r >> x; // Account for the current day using the old schedule. if (r >= 1) sync(r, day); if (r + 1 < N) sync(r + 1, day); t[r] = x; } else { int r; cin >> r; sync(r, day); cout << watered[r] << '\n'; } } return 0; }
Kimi K3.1 Pro · 采样 3 · 60 行
#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 (auto &x : t) cin >> x; vector<long long> watered(N, 0); vector<int> nextDay(N, 0); vector<bool> waters(N, false); for (int r = 1; r < N; ++r) { waters[r] = t[r] < t[r - 1]; } auto sync = [&](int r, int day) { if (nextDay[r] <= day) { if (waters[r]) { watered[r] += day - nextDay[r] + 1; } nextDay[r] = day + 1; } }; for (int day = 0; day < D; ++day) { char type; cin >> type; if (type == '?') { int r; cin >> r; sync(r, day); cout << watered[r] << '\n'; } else { int r; long long x; cin >> r >> x; if (r >= 1) sync(r, day); if (r + 1 < N) sync(r + 1, day); t[r] = x; if (r >= 1) { waters[r] = t[r] < t[r - 1]; } if (r + 1 < N) { waters[r + 1] = t[r + 1] < t[r]; } } } return 0; }
DeepSeek Flash V4.1-1017 · 采样 1 · 61 行
#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]; vector<int> state(N, 0); vector<int> start(N, 0); vector<long long> acc(N, 0); for (int p = 1; p < N; ++p) { state[p] = (t[p] < t[p - 1]) ? 1 : 0; start[p] = 0; } for (int day = 0; day < D; ++day) { char op; cin >> op; if (op == '?') { int r; cin >> r; int p = r; long long ans = acc[p] + 1LL * state[p] * (day - start[p] + 1); cout << ans << '\n'; } else { int r; long long x; cin >> r >> x; int affected[2]; int cnt = 0; if (r >= 1) affected[cnt++] = r; if (r + 1 < N) affected[cnt++] = r + 1; for (int i = 0; i < cnt; ++i) { int p = affected[i]; acc[p] += 1LL * state[p] * (day - start[p] + 1); } t[r] = x; for (int i = 0; i < cnt; ++i) { int p = affected[i]; state[p] = (t[p] < t[p - 1]) ? 1 : 0; start[p] = day + 1; } } } return 0; }
DeepSeek Flash V4.1-1017 · 采样 2 · 55 行
#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]; vector<long long> base(N, 0), last(N, 0); vector<int> active(N, 0); for (int r = 1; r < N; ++r) { active[r] = (t[r] < t[r - 1]); } for (int day = 0; day < D; ++day) { char type; cin >> type; if (type == '?') { int r; cin >> r; long long ans = base[r] + 1LL * active[r] * ((long long)day - last[r] + 1); cout << ans << '\n'; } else { int r; long long x; cin >> r >> x; vector<int> affected; if (r >= 1) affected.push_back(r); if (r + 1 < N) affected.push_back(r + 1); for (int e : affected) { base[e] += 1LL * active[e] * ((long long)day - last[e] + 1); last[e] = (long long)day + 1; } t[r] = x; for (int e : affected) { active[e] = (t[e] < t[e - 1]); } } } return 0; }
DeepSeek Flash V4.1-1017 · 采样 3 · 61 行
#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]; vector<char> active(N, 0); vector<long long> sum(N, 0), last(N, -1); for (int i = 1; i < N; ++i) { active[i] = (t[i] < t[i - 1]); } auto updateEdge = [&](int e, int day) { if (e < 1 || e >= N) return; bool newActive = (t[e] < t[e - 1]); if (newActive != (bool)active[e]) { if (active[e]) { sum[e] += (long long)day - last[e]; } last[e] = day; active[e] = newActive; } }; for (int day = 0; day < D; ++day) { char type; cin >> type; if (type == '?') { int r; cin >> r; long long ans = sum[r]; if (active[r]) { ans += (long long)day - last[r]; } cout << ans << '\n'; } else { int r; long long x; cin >> r >> x; t[r] = x; updateEdge(r, day); updateEdge(r + 1, day); } } return 0; }
MiniMax M3.1 Flash · 采样 1 · 69 行
#include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int N, D; cin >> N >> D; vector<int> t(N); for (int &x : t) cin >> x; // Edge e represents resident e watering for resident e - 1. vector<char> good(N, false); vector<int> segmentStart(N, 0); vector<long long> completed(N, 0); for (int e = 1; e < N; ++e) { good[e] = (t[e] < t[e - 1]); } // Close the current constant segment of edge e, which lasts // from segmentStart[e] through day. auto closeSegment = [&](int e, int day) { if (good[e]) { completed[e] += static_cast<long long>(day) - segmentStart[e] + 1; } }; for (int day = 0; day < D; ++day) { char type; int r; cin >> type >> r; if (type == '!') { int x; cin >> x; // Changing t[r] can affect only edges r and r + 1. int e1 = (r >= 1 ? r : -1); int e2 = (r + 1 < N ? r + 1 : -1); // The old values apply through the current day. if (e1 != -1) closeSegment(e1, day); if (e2 != -1) closeSegment(e2, day); t[r] = x; // The new values apply starting from the next day. if (e1 != -1) { good[e1] = (t[e1] < t[e1 - 1]); segmentStart[e1] = day + 1; } if (e2 != -1) { good[e2] = (t[e2] < t[e2 - 1]); segmentStart[e2] = day + 1; } } else { // type == '?' long long answer = completed[r]; if (good[r]) { answer += static_cast<long long>(day) - segmentStart[r] + 1; } cout << answer << '\n'; } } return 0; }
MiniMax M3.1 Flash · 采样 2 · 57 行
#include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int N, D; cin >> N >> D; vector<int> t(N); for (int &x : t) cin >> x; // Edge e represents the relation between resident e and resident e-1. // active[e] is true when resident e waters resident e-1. vector<unsigned char> active(N, 0); vector<long long> answer(N, 0); // nextDay[e] is the first day not yet included in answer[e]. vector<int> nextDay(N, 0); for (int e = 1; e < N; ++e) { active[e] = (t[e] < t[e - 1]); } // Account for all unprocessed days using the currently stored result. auto closeEdge = [&](int e, int day) { answer[e] += 1LL * active[e] * (day - nextDay[e] + 1); nextDay[e] = day + 1; }; for (int day = 0; day < D; ++day) { char type; int r; cin >> type >> r; if (type == '!') { int x; cin >> x; // The old schedule applies through this day. if (r >= 1) closeEdge(r, day); if (r + 1 < N) closeEdge(r + 1, day); // The new schedule applies starting from the next day. t[r] = x; if (r >= 1) active[r] = (t[r] < t[r - 1]); if (r + 1 < N) active[r + 1] = (t[r + 1] < t[r]); } else { closeEdge(r, day); cout << answer[r] << '\n'; } } return 0; }
MiniMax M3.1 Flash · 采样 3 · 121 行
#include <bits/stdc++.h> using namespace std; struct Change { int start; // First day on which this value is used int value; }; struct Query { int day; int id; }; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int N, D; cin >> N >> D; vector<int> initial(N); for (int &x : initial) { cin >> x; } vector<vector<Change>> changes(N); for (int r = 0; r < N; ++r) { changes[r].push_back({0, initial[r]}); } vector<vector<Query>> queries(N); int queryCount = 0; for (int day = 0; day < D; ++day) { char type; cin >> type; if (type == '!') { int r, x; cin >> r >> x; // The new return time starts on the next day. changes[r].push_back({day + 1, x}); } else { int r; cin >> r; queries[r].push_back({day, queryCount++}); } } vector<long long> answer(queryCount); constexpr int INF = numeric_limits<int>::max(); for (int r = 1; r < N; ++r) { if (queries[r].empty()) { continue; } const auto &lowerChanges = changes[r - 1]; const auto &upperChanges = changes[r]; size_t lowerPos = 1; // Skip the initial value size_t upperPos = 1; int lowerValue = initial[r - 1]; int upperValue = initial[r]; int segmentStart = 0; long long completed = 0; for (const Query &query : queries[r]) { // Apply all schedule changes effective by this query day. while (true) { int lowerBoundary = lowerPos < lowerChanges.size() ? lowerChanges[lowerPos].start : INF; int upperBoundary = upperPos < upperChanges.size() ? upperChanges[upperPos].start : INF; int boundary = min(lowerBoundary, upperBoundary); if (boundary > query.day) { break; } // Close the segment [segmentStart, boundary). if (upperValue < lowerValue) { completed += boundary - segmentStart; } segmentStart = boundary; if (lowerBoundary == boundary) { lowerValue = lowerChanges[lowerPos].value; ++lowerPos; } if (upperBoundary == boundary) { upperValue = upperChanges[upperPos].value; ++upperPos; } } long long result = completed; if (upperValue < lowerValue) { result += query.day - segmentStart + 1; } answer[query.id] = result; } } for (long long result : answer) { cout << result << '\n'; } return 0; }