跳到正文

生活·游记

NOIP2024迷惑行为大赏-GS篇(持续更新中)

LanzhouPaimonLucas约 7 分钟
原文
文章信息与版本

文章信息

收录
2026年3月20日
更新
2026年7月16日
篇幅
约 7 分钟

版本

  1. v1当前

本文中的代码均为GS赛时代码(不包括体验选手)

GS-0001至GS-0010

GS-0001:

全省(甚至全国)最长框架代码\

C++
#include <cstdio>
#include <cstring>
#include <numeric>
#include <cmath>
#include <cctype>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <algorithm>

namespace uvu
{
#define LOCAL ____________DONT_DEFINE_ME____________
#define ll long long
#define inf 0x3f3f3f3f
// #define int long long
// #define inf 0x3f3f3f3f3f3f3f3fll
#define infll 0x3f3f3f3f3f3f3f3fll
#define debug(...) fprintf(stderr, __VA_ARGS__)
#define gline debug("now is #%d\n", __LINE__)
#define pii std::pair <int, int>
#define mkp std::make_pair
#define fi first
#define se second
char getc() { return getchar(); }
void putc(char c) { putchar(c); }
char _ST_;
template <typename T = int> T read()
{
    T x = 0, f = 1; char c = getc();
    for(; !isdigit(c); c = getc()) if(c == '-') f = -1;
    for(;  isdigit(c); c = getc()) x = (x << 3) + (x << 1) + (c ^ 48);
    return x * f;
}
template <typename T> void print(T x, char c)
{
static int sta[1 << 20], top;
    top = 0;
    if(!x) sta[++top] = 0;
    if(x < 0) x *= -1, putc('-');
    for(; x; x /= 10) sta[++top] = x % 10;
    for(; top; putc(sta[top--] ^ 48));
    if(c) putc(c);
}
void printf(const char *s) { for(; *s; s++) putc(*s); }
template <typename T, typename ... Args>
void printf(const char *s, T x, Args ... rest)
{
    for(; *s; s++)
    {
        if(*s != '%') { putc(*s); continue; }
        s++; if(*s == 'd') print(x, 0);
        else if(*s == 'c') putc(x);
        printf(s + 1, rest ...);
        return;
    }
}
int readstr(char *s, int base)
{
    int idx = base - 1; char c = getc();
    for(; !(isdigit(c) || isalpha(c) || c == '#'); c = getc());
    for(;   isdigit(c) || isalpha(c) || c == '#' ; c = getc()) s[++idx] = c;
    return idx - base + 1;
}

template <typename T> void ckmin(T &x, T y) { x = x < y ? x : y; }
template <typename T> void ckmax(T &x, T y) { x = x > y ? x : y; }
#define mod 998244353
// #define mod 1000000007
int sm(int x) { return x >= mod ? x - mod : x; }
void plus_(int &x, int y) { x = sm(x + y); }
void mul_(int &x, int y) { x = 1ll * x * y % mod; }
int ksm(int a, int b) { int res = 1; for(; b; b >>= 1, mul_(a, a)) if(b & 1) mul_(res, a); return res; }

void solve()
{
    // memset(h, idx = -1, sizeof(h));
    ll a = read<ll>(), b = read<ll>();

}

void init()
{

}
char _ED_;
void mian()
{
    debug("%.3f MB\n", abs(&_ST_ - &_ED_) / 1024.0 / 1024);
    init(); int T = 1;
    for(; T; solve(), T--);
}

#ifdef int
    #undef int
#endif
}

int main()
{
    freopen("tmp.in", "r", stdin);
    freopen("tmp.out", "w", stdout);
    uvu::mian(); return 0;
}

共计105行,包含快读以及一些笔者看不懂的小技巧

GS-0002:

暂无

GS-0003:

traverse.cpp和query.cpp均未提交

GS-0004:

traverse.cpp和query.cpp均未提交

GS-0005:

traverse.cpp和query.cpp均未提交
来自edit.cpp:
共281行7KB,疑似全场最长

GS-0006:(有东西)

“assign.cpp”错写成”assigent.cpp”

C++
freopen("assigent.in","r",stdin);
freopen("assigent.out","w",stdout);

惨痛的爆零一周目

“traverse.cpp”错写成”treaver.cpp”

C++
freopen("treaver.in","r",stdin);
freopen("treaver.out","w",stdout);

惨痛的爆零二周目
请各位选手有则改之,无则加勉,避免考场能A的题爆零,甚至提前AFO!!!

来自traver.cpp:

C++
printf("%d\n",rand()*rand()*rand()%1000000007L);

高级的随机答案生成器

GS-0007:

正在生成,敬请期待

原文