跳到正文

个人记录

学习

errosia约 2 分钟
原文
文章信息与版本

文章信息

发布
2021年1月26日
收录
2026年2月18日
更新
2026年11月18日
篇幅
约 2 分钟

版本

  1. v2当前
  2. v1

主函数


C++
#include <iostream>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
typedef long long ll;
const int INF = 2147483647;
const int N = 1e0 + 10;
int main()
{
	cin.tie(0), cout.tie(0);
	ios::sync_with_stdio(0);

	return 0;
}

快读


C++
int read()
{
	int p = 0, w = 1;
	char ch = getchar();
	while(ch < '0' || ch > '9') {if(ch == '-') w = -1; ch = getchar();}
	while(ch >= '0' && ch <= '9') p = p * 10 + (ch ^ 48), ch = getchar();
	return p * w;
}

对拍


随机函数

C++
#include <ctime>
srand(time(0));
int i = rand();

对拍程序

C++
#include <iostream>
#include <ctime>
using namespace std;
int main()
{
	int n = 100;
	for(int i = 1; i <= n; i++)
	{
		system("data.exe > data.txt");
		system("std.exe < data.txt > std.txt");
		double begin = clock();
		system("test.exe < data.txt > test.txt");
		double end = clock();
		if(system("fc test.txt std.txt")) return puts("Wrong answer"), 0;
//		else printf("Accepted  #%d  %.0lfms\n", i, end - begin);
	}
	return 0;
}
原文
存档评论1 条抓取于