跳到正文

Funny_Valentine

1580560

在洛谷打开
资料、奖项与版本

资料

编号
1580560
抓取

吾心吾行澄如明镜,所作所为皆属『正义』。

我が心と行动に一点の曇リなし,全てが『正义』だ。

纪念

达成成就: 于深渊中凝视

Windows 10 x64 VMware Workstation 2025 8 28 15 42 53

达成成就:「Keep Coding」

Snipaste 2025 09 23 16 40 57

图床

DeepSeek

再见,学生机房管理系统

太极

Z-Library

神秘代码

C++
ios::sync_with_stdio(false);
cin.tie(0);cout.tie(0);

神秘代码(2)

C++
#pragma optimize(1)
#pragma optimize(2)
#pragma optimize(3)

支持负数的普通快读

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

判断互质

C++
bool f(int x, int y) {
    while (y != 0) {  
        if (x < y) swap(x, y);
        int r = x % y;
        x = y;
        y = r;
    }
    return x == 1; 
}

判断质数

C++
bool f(const int &n){
	int x = sqrt(n)+1;
	for(int i = 2; i < x; i++){
		if(n%i == 0){
			return 0;
		}
	}
	return 1;
}

进制转换(十进制转n进制)

C++
string f(int num, int base) {
    string str;
    do{
        int remainder = num % base;
        if (remainder < 10) {
            str += '0' + remainder;
        } else {
            str += 'A' + remainder - 10;
        }
        num /= base;
    } while (num != 0);
    reverse(str.begin(), str.end());
    return str;
}

进制转换(n进制转十进制)

C++
int f(const string &str, int base) {
    int n = 0;
    int m = 1;
    for (int i = str.length() - 1; i >= 0; --i) {
        int x = 0;
        if (str[i] >= '0' && str[i] <= '9') {
            x = str[i] - '0';
        } else {
            x = str[i] - 'A' + 10;
        }
        n += x * m;
        m *= base;
    }
    return n;
}

关闭极域

C++
#include <windows.h>
#include <iostream>
#include <vector>
#include <tlhelp32.h>

std::vector<DWORD> GetPIDsByName(const wchar_t* processName) {
    std::vector<DWORD> pids;
    HANDLE hSnapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
    if (hSnapshot == INVALID_HANDLE_VALUE) return pids;

    PROCESSENTRY32W pe;
    pe.dwSize = sizeof(PROCESSENTRY32W);
    
    if (Process32FirstW(hSnapshot, &pe)) {
        do {
            if (wcscmp(pe.szExeFile, processName) == 0) {
                pids.push_back(pe.th32ProcessID);
            }
        } while (Process32NextW(hSnapshot, &pe));
    }
    CloseHandle(hSnapshot);
    return pids;
}

bool KillProcessByID(DWORD pid) {
    HANDLE hProcess = OpenProcess(PROCESS_TERMINATE, FALSE, pid);
    if (!hProcess) return false;
    
    BOOL result = TerminateProcess(hProcess, 1);
    CloseHandle(hProcess);
    return result;
}

int main() {
    while(true) {
        // 关闭StudentMain.exe
        std::vector<DWORD> studentPIDs = GetPIDsByName(L"StudentMain.exe");
        for (DWORD pid : studentPIDs) {
            KillProcessByID(pid);
        }
        
        Sleep(700);
    }
    return 0;
}

连点器

C++
#include <windows.h>
#include <bits/stdc++.h>
using namespace std;
string str;
int start_time,sleep_time;
int main(){
	begin:
    printf("左:left  右:right\n");
    printf("请输入连点类型:\n");
    cin >> str;
    printf("请输入连点间隔(单位:毫秒):\n");
    scanf("%d",&sleep_time);
    printf("请输入开始时间(单位:毫秒):\n");
    scanf("%d",&start_time);
    printf("OK,将在%.3lf秒后开始连点\n请注意:想要停止连点可以按ESC退出\n",(double)start_time/1000);
    Sleep(start_time);
    if(str=="left"){
        while(1){
            mouse_event(MOUSEEVENTF_LEFTDOWN | MOUSEEVENTF_LEFTUP,0,0,0,0);
            Sleep(sleep_time);
            if(GetAsyncKeyState(VK_ESCAPE)){
                break;
            }
        }
    }
    if(str=="right"){
        while(1){
            mouse_event(MOUSEEVENTF_RIGHTDOWN | MOUSEEVENTF_RIGHTUP,0,0,0,0);
            Sleep(sleep_time);
            if(GetAsyncKeyState(VK_ESCAPE)){
                break;
            }
        }
    }
    printf("输入1重新启动");
    int n;
    cin >> n;
    if(n == 1){
    	system("cls");
	}else{
		return 0;
	}
}

伪随机

C++
#include<sys/time.h>
#include<bits/stdc++.h>
using namespace std;
int GBMT(int a){
	int ex=ceil(log10(a));
	return pow(10,ex);
}
int randed(int n){
	if(n==0)return 0;
	else{
		n++;
		struct timeval tv;
		gettimeofday(&tv,NULL);
		long long ms=tv.tv_sec*1000LL+tv.tv_usec/1000;
		return ms/(rand()%9+1)%n;
	}
}
int main(){
    
	return 0;
}

还没有收录这位用户的文章。