跳到正文

GX6zm

1709391

为啥 1∈2 啊

这是 2026年11月23日 存档的第 8 版,不是当前版本。查看当前版本

资料、奖项与版本
常用链接

球球

记录

安迪云

Clash verge

DEVCPP

if 中文乱码
  • 编译命令 -fexec-charset=gbk
  • 工具->编辑器选项->显示-><ID 27071 translation missing> 取消其前面的勾选

图床

表情包

rabbit网盘(密码同上)

轻小说

cnblogs

geogebra

画图工具

原题机

6657

小番茄混淆工具

鱼笑川

快速IO
C++
#include<bits/stdc++.h>
#if defined(_WIN32)
	#define gc _getchar_nolock
	#define pc _putchar_nolock
#else
	#define gc getchar_unlocked
	#define pc putchar_unlocked
#endif
#define edl pc('\n')
using namespace std;
int rd(){
	int x = 0, d = 1; int c = gc();
	while (!isdigit(c)){if (c == '-') d = -1; c = gc();}
	while (isdigit(c)) x *= 10, x += c - '0', c = gc();
	return x * d;
}
void put(unsigned int x){
	int n = 0; char c[32];
	do{
		c[n++] = x % 10 + '0';
		x /= 10;
	}while(x);
	while(n--) pc(c[n]);
}
void wt(int x){
	unsigned int ux = x;
	if (x < 0) ux = -ux, pc('-');
	put(ux);
}
对拍/调试用
C++
#include <bits/stdc++.h>
using namespace std;
int main() {
    srand((unsigned)time(nullptr));
    
    system("g++ -O2 -std=c++14 gen.cpp -o gen");
    system("g++ -O2 -std=c++14 fixedhuman.cpp -o brute");
    system("g++ -O2 -std=c++14 human.cpp -o std");
	cout << "编译完成\n";
	
    for (int i = 1;; i++) {
        int seed = rand();
        system(("gen.exe " + to_string(seed) + " > data.in").c_str());

        auto std_start = chrono::steady_clock::now();
        system("std.exe < data.in > std.out");
        auto std_end = chrono::steady_clock::now();

        double std_time = chrono::duration<double, milli>(std_end - std_start).count();

        auto brute_start = chrono::steady_clock::now();
        system("brute.exe < data.in > brute.out");
        auto brute_end = chrono::steady_clock::now();
        double brute_time = chrono::duration<double, milli>(brute_end - brute_start).count();

        if (system("fc std.out brute.out")) {
            cout << "WA seed = " << seed << endl;
            cout << "std time:   " << fixed << setprecision(3) << std_time << " ms\n";
            cout << "brute time: " << fixed << setprecision(3) << brute_time << " ms\n";
            return 0;
        }

        cout << "Test " << i << " OK | std: " << fixed << setprecision(3) << std_time 
             << " ms, brute: " << brute_time << " ms" << endl;
    }

    return 0;
}