题目 › fcs-77

FrontierCS #77

FrontierCS 算法赛道 v1.1 · 2026-05 · L5 开放式 · C++17 · 时限 3 秒 · 0–100 连续分

查看原题跳到结果

题面

来源:FrontierCS 官方 statement.txt,与模型收到的题面相同。

Problem: Time limit: 3 seconds Memory limit: 512 megabytes The popular improv website Interpretation Impetus hosts regular improv contests and maintains a rating of the best performers. However, since improv can often go horribly wrong, the website is notorious for declaring improv contests unrated. It now holds a wager before each improv contest where the participants try to predict whether it will be rated or unrated, and they are now more popular than the improv itself. Izzy andnother participants take part in each wager. First, they each make their prediction, expressed as 1 (“rated”) or0 (“unrated”). Izzy always goes last, so she knows the predictions of the other participants when making her own. Then, the actual competition takes place and it is declared either rated or unrated. You need to write a program that will interactively play as Izzy. There will be m wagers held in 2021, and Izzy’s goal is to minimize the number of wrong predictions after all those wagers. Izzy knows nothing about the other participants /emdash.cyr they might somehow always guess correctly, or their predictions might be correlated. Izzy’s predictions, though, do not affect the predictions of the other participants and the decision on the contest being rated or not /emdash.cyr in other words, in each test case, your program always receives the same inputs, no matter what it outputs. Interaction Protocol First, a solution must read two integers n (1 ≤n ≤1000) and m (1 ≤m ≤10 000). Then, the solution must process m wagers. For each of them, the solution must first read a string consisting of n 0s and 1s, in which the i-th character denotes the guess of the i-th participant. Then, the solution must print Izzy’s guess as 0 or 1. Don’t forget to flush the output after printing it! Then, the solution must read the actual outcome, also as 0 or 1, and then proceed to the next wager, if this wasn’t the last one. ## Scoring Let x be c, your number of wrong predictions. b is the smallest number of mistakes made by another participant. If b=0, award 100 for c=0 and 0 otherwise. The physical reference (the 60-point level) is a=b. Define the lower-band continuation: L(x) = 60*max(0,(2*b-x)/b). For positive x and positive physical reference a, define the improvement factor r=a/x. The physical reference has r=1 and earns 60 points. For a valid output on this branch, the points P are: P = 100, if x=0; P = L(x), if L(x)<=60; P = min(100,60+ln(r)), otherwise. Here ln is the natural logarithm. In the upper branch before the 100-point cap, r=exp(P-60): each additional point requires an e-fold improvement in the physical objective (division by e). All feasibility, correctness, and hard resource-limit checks remain required; invalid output receives 0. Across test files, use the arithmetic mean of the file scores. Any prediction other than 0 or 1 is invalid, regardless of the other predictions. There are 200 test cases in this problem. Example standard input standard output 3 4 000 1 100 1 001 0 111 1 0 0 1 1 Note In the example, the participants made 1, 2, and 3 mistakes respectively, so b = 1. Izzy made 3 mistakes, giving L(3)=60*max(0,(2-3)/1)=0 and a score of 0 points. Page 12 of 14

结果

Kimi K3.1 ProKimi

max

49.4

平均得分 ↑

  • 49.4采样 1 · 部分分
  • 22.2k平均输出 token(含思考) ↓
  • 28.6输出速度 tokens/s ↑
  • 778 秒延迟 ↓

Kimi K3.1 Pro(high)Kimi high

high

53.5

平均得分 ↑

  • 53.5采样 1 · 部分分
  • 12.1k平均输出 token(含思考) ↓
  • 24.6输出速度 tokens/s ↑
  • 495 秒延迟 ↓

DeepSeek Flash V4.1-1017DeepSeek

auto(high)

52.7

平均得分 ↑

  • 52.7采样 1 · 部分分
  • 23.9k平均输出 token(含思考) ↓
  • 192.2输出速度 tokens/s ↑
  • 125 秒延迟 ↓

MiniMax M3.1 FlashMiniMax

auto(max)

59.1

平均得分 ↑

  • 59.1采样 1 · 部分分
  • 49.9k平均输出 token(含思考) ↓
  • 143.2输出速度 tokens/s ↑
  • 350 秒延迟 ↓

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

代码

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

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

    int n, m;
    if (!(cin >> n >> m)) return 0;

    vector<int> losses(n, 0);
    mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());

    const double logN = log(static_cast<double>(n) + 1.0);

    for (int round = 0; round < m; ++round) {
        string predictions;
        cin >> predictions;

        int bestLoss = *min_element(losses.begin(), losses.end());
        double eta = min(4.0, sqrt(2.0 * logN / max(1, bestLoss)));

        double totalWeight = 0.0;
        double weightOne = 0.0;

        for (int i = 0; i < n; ++i) {
            double weight = exp(-eta * static_cast<double>(losses[i] - bestLoss));
            totalWeight += weight;
            if (predictions[i] == '1') weightOne += weight;
        }

        double probabilityOne = weightOne / totalWeight;
        int guess;

        if (probabilityOne <= 0.0) {
            guess = 0;
        } else if (probabilityOne >= 1.0) {
            guess = 1;
        } else {
            double u = generate_canonical<double, 64>(rng);
            guess = (u < probabilityOne) ? 1 : 0;
        }

        cout << guess << endl;

        int outcome;
        cin >> outcome;

        for (int i = 0; i < n; ++i) {
            if (predictions[i] - '0' != outcome) ++losses[i];
        }
    }

    return 0;
}