跳到正文

休闲·娱乐

[警告:大粪]随机通过A+B

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

文章信息

收录
2025年12月12日
更新
2025年12月12日
篇幅
约 2 分钟

版本

  1. v2当前
  2. v1
C++
#include <bits/stdc++.h>
using namespace std;
int rd(int max) {
    static std::random_device rd;
    static std::mt19937 gen(rd());

    if (max < 0) return 0;
    std::uniform_int_distribution<> dis(0, max);
    return dis(gen);
}
void AC(int x, int y) {
	cout<<x+y<<endl;
}
void WA(int x, int y) {
	cout<<x+y+1<<endl;
}
void TLE() {
	std::this_thread::sleep_for(std::chrono::seconds(20000));
	while(1 == 1){
		cout<<"oop";
	}
}
void MLE() {
	while (true) {
		int *a= new int[1000000];
	}
}
void OLE() {
	while(1 == 1){
		cout<<"oop";
	}
}
void RE() {
	throw 666;
}
int main() {
	int x, y;
	cin>>x>>y;
	int p = rd(5);
	if (p == 0) {
		MLE();
	} else if (p == 1) {
		RE();
	} else if (p == 2) {
		WA(x, y);
	} else if (p == 3) {
		TLE();
	} else if (p == 4) {
		OLE();
	} else {
		AC(x, y);
	}
}
原文