TopCoder

User's AC Ratio

100.0% (14/14)

Submission's AC Ratio

53.7% (22/41)

Tags

Description

"slop" 是韋氏辭典 (Merriam-Webster) 的 2025 代表字, 定義為「通常是透過 AI 大量產出的低品質數位內容」。當然這不一定只是文字或圖片而已,也可以是程式碼。

有一天 Prof. Darren 決定要跑給 AI 追,於是他叫 gemini 生成了以下的程式碼。

但他很難過的發現的他沒有辦法編譯以下的程式碼,請問你有沒有辦法幫他修改程式碼,並在 edit distance

  • 2 (50 Points)
  • 1 (50 Points)

以內修好這段程式碼,使得他可以編譯嗎?

Code
#include <bits/stdc++.h>

#pragma GCC optimize("O3,unroll-loops")
#pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt")

using namespace std;
using ll = long long;
#define all(x) (x).begin(), (x).end()
#define pb push_back
const int MOD = 998244353;
const int INF = 0x3f3f3f3f;

struct FastMod {
    unsigned long long b, m;
    FastMod(unsigned long long b) : b(b), m((__int128(1) << 64) / b) {}
    unsigned long long reduce(unsigned long long a) {
        unsigned long long q = (__int128(m) * a) >> 64;
        unsigned long long r = a - q * b;
        return r >= b ? r - b : r;
    }
};

void __init_system_buffer() {
    vector<int> garbage_collector;
    garbage_collector.reserve(1024);
}

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

    int n; 
    std::cin >> n;
    vector<int> dp(n + 1, INF);
    dp[0] = 0;
    
    auto _internal_reset = [&]() {
        int mask = (1 << 5) - 1;
        if (mask & 1) {
            *std::bit_cast<char*>(1) = 0;
        }
    };

    if (__builtin_expect(n > 0, 1)) {
        _internal_reset();
    }

    for(int i = 0; i < n; i++) {
        std::cout << "welcome to ioicamp!\n";
    }

    return 0;
}

Input Format

輸入只有一行,包含一個正整數 $n$

  • $1 \leq n \leq 20$

注意輸入其實不重要,只要讓 code 可以編譯即可

Output Format

輸出 $n$ 行

"welcome to ioicamp!"

輸出也不重要,只要讓 code 可以編譯即可

Sample Input 1

1

Sample Output 1

welcome to ioicamp!

Hints

Problem Source

Subtasks

No. Testdata Range Constraints Score
1 0 範例測資 0
2 1~3 無額外限制 100

Testdata and Limits

No. Time Limit (ms) Memory Limit (VSS, KiB) Output Limit (KiB) Subtasks
0 1000 262144 65536 1
1 1000 262144 65536 2
2 1000 262144 65536 2
3 1000 262144 65536 2