跳到正文

zengjunyangQQ

1363223

这个家伙很懒,什么也没有留下

这是 2026年10月27日 存档的第 2 版,不是当前版本。查看当前版本

资料、奖项与版本

资料

编号
1363223
抓取

版本

  1. v3当前
  2. v2
  3. v1

P1196 P2294 P2085 P2168 P2939 P1073 P2047 P1991 P2872 P5829 P3763 P2422 P3467 P3522 P2216 P4551 P3065 P2357 P3608 P1972 P1471 P6327 P2894 P2572 P3243 P3620 P1273 P1270 P2585 P2764 P3254 P2597 P2805 P2748 P10478 P11268

秃头窗口
C++
#include<iostream>
#include<windows.h>
#include<vector>
using namespace std;
HWND hWnd=GetForegroundWindow();
int srcw=GetSystemMetrics(SM_CXSCREEN);
int srch=GetSystemMetrics(SM_CYSCREEN);
bool key[4];//WSAD
POINT mousepos;
void getkey(){
	key[0]=(GetAsyncKeyState('W')|GetAsyncKeyState(VK_UP))&0x8000;
	key[1]=(GetAsyncKeyState('S')|GetAsyncKeyState(VK_DOWN))&0x8000;
	key[2]=(GetAsyncKeyState('A')|GetAsyncKeyState(VK_LEFT))&0x8000;
	key[3]=(GetAsyncKeyState('D')|GetAsyncKeyState(VK_RIGHT))&0x8000;
}
bool inline inside(int x,int y,int w,int h,int mx,int my){
	return mx>=x&&mx<x+w&&my>=y&&my<y+h;
}
bool inline inside(int x,int l,int r){
	return x>l&&x<r;
}
BOOL CALLBACK EnumWindowsProc(HWND hwnd,LPARAM lParam){
	vector<HWND>* data=reinterpret_cast<vector<HWND>*>(lParam);
	data->push_back(hwnd);
	return TRUE;
}
vector<RECT> windowsRect;
vector<HWND> hwnds;
void getWindowsRect(){
	windowsRect.clear();
	//static vector<HWND> hwnds;
	hwnds.clear();RECT rect;
	EnumWindows(EnumWindowsProc,(LPARAM)&hwnds);
	for(int i=0; i<hwnds.size(); i++) {
		HWND hwnd=hwnds[i];
		GetWindowRect(hwnd,&rect);

		char buf[256]={0};
		GetWindowText(hwnd,buf,sizeof(buf));
		LONG style=GetWindowLong(hwnd,GWL_STYLE);
		LONG exStyle=GetWindowLong(hwnd,GWL_EXSTYLE);

		bool isValid=
			IsWindowVisible(hwnd)&&		// 排除不可见窗口
			!IsIconic(hwnd)&&			// 排除最小化窗口
			(style&WS_VISIBLE)&&		// 必须包含可见样式
			!(style&WS_MINIMIZE)&&		// 排除最小化样式
			(rect.right-rect.left>5)&&	// 增加宽度阈值
			(rect.bottom-rect.top>5)&&	// 增加高度阈值
			(buf[0]!='\0')&&
			(hwnd!=hWnd);

		if(isValid) windowsRect.push_back(rect);
	}
}
int collideY(int x,int y,int w,int h){
	if(y<0) return 0;
	if(y+h>srch) return srch-h;
	for(auto& r:windowsRect){
		if(inside(x,r.left,r.right)||inside(x+w,r.left,r.right)){
			if(inside(r.top,y,y+h)){
				if(y+h/2>r.top) return r.top;
				return r.top-h;
			}else if(inside(r.bottom,y,y+h)){
				if(y+h/2<r.bottom) return r.bottom-h;
				return r.bottom;
			}
		}
	}
	return -114514;
}
int collideX(int x,int y,int w,int h){
	if(x<0) return 0;
	if(x+w>srcw) return srcw-w;
	for(auto& r:windowsRect){
		if(inside(r.top,y,y+h)||inside(r.bottom,y,y+h)){
			if(inside(r.left,x,x+w)) return r.left-w;
			else if(inside(r.right,x,x+w)) return r.right;
		}
	}
	return -114514;
}
int main(){
	cout << "                    \n";
	cout << "                    \n";
	cout << "    O( ∩ _ ∩ )O    \n";
//	cout << "                    \n";
//	cout << "                    \n";
//	cout << "                    \n";
//	cout << "                    \n";
//	cout << "                    \n";
//	cout << "                    \n";
	cout << "                    ";
	int op = 60;
	float x=1,y=1,sx=0,sy=0,cx=200,cy=200,cyy=0;
	while(op --){
		getkey();
		GetCursorPos(&mousepos);
		getWindowsRect();
		sx+=(key[3]-key[2]);sy+=0.5f;
		if(key[0])
			if(collideY(x,y,cx,cy+2)!=-114514||inside(x,y+cy*0.8f,cx,cy*0.2f,mousepos.x,mousepos.y-2))
				sy=-15;
		y+=sy;
		if(inside(x,y+cy*0.8f,cx,cy*0.2f,mousepos.x,mousepos.y-2)){ y=mousepos.y-cy;sy=0; }
		int c=collideY(x,y,cx,cy);
		if(c!=-114514){ y=c;sy=0; }
		x+=sx;
		if(inside(x,y+cy*0.2f,cx,cy*0.6f,mousepos.x,mousepos.y)){
			if(x+cx/2>mousepos.x) x=mousepos.x;
			else x=mousepos.x-cx;
			if(key[0]){ sy=-15;sx=sx<0?10:-10; }else sx=0;
		}
		c=collideX(x,y,cx,cy);
		if(c!=-114514){
			x=c;
			if(key[0]){ sy=-15;sx=sx<0?10:-10; }else sx=0;
		}
		sx*=0.9f;
		cyy+=(key[1]*cy/2-cyy)*0.5f;
		SetWindowPos(hWnd,HWND_TOPMOST,x,y+cyy,cx,cy-cyy,SWP_SHOWWINDOW);
		Sleep(20);
	}
	system("cls");
	cout << "                    \n";
	cout << "                    \n";
	cout << "Hi~ o(* ̄▽ ̄*)ブ  \n";
//	cout << "                    \n";
//	cout << "                    \n";
//	cout << "                    \n";
//	cout << "                    \n";
//	cout << "                    \n";
//	cout << "                    \n";
	cout << "                    ";
	op = 100;
	while(op --){
		getkey();
		GetCursorPos(&mousepos);
		getWindowsRect();
		sx+=(key[3]-key[2]);sy+=0.5f;
		if(key[0])
			if(collideY(x,y,cx,cy+2)!=-114514||inside(x,y+cy*0.8f,cx,cy*0.2f,mousepos.x,mousepos.y-2))
				sy=-15;
		y+=sy;
		if(inside(x,y+cy*0.8f,cx,cy*0.2f,mousepos.x,mousepos.y-2)){ y=mousepos.y-cy;sy=0; }
		int c=collideY(x,y,cx,cy);
		if(c!=-114514){ y=c;sy=0; }
		x+=sx;
		if(inside(x,y+cy*0.2f,cx,cy*0.6f,mousepos.x,mousepos.y)){
			if(x+cx/2>mousepos.x) x=mousepos.x;
			else x=mousepos.x-cx;
			if(key[0]){ sy=-15;sx=sx<0?10:-10; }else sx=0;
		}
		c=collideX(x,y,cx,cy);
		if(c!=-114514){
			x=c;
			if(key[0]){ sy=-15;sx=sx<0?10:-10; }else sx=0;
		}
		sx*=0.9f;
		cyy+=(key[1]*cy/2-cyy)*0.5f;
		SetWindowPos(hWnd,HWND_TOPMOST,x,y+cyy,cx,cy-cyy,SWP_SHOWWINDOW);
		Sleep(20);
	}
	int now_f = -1, opp = 0, f = 1, fff = 0, sum = 0;
	while(1){
		if(sum >= 5){
			system("cls");
			cout << "\n";
			cout << "I'm angry! \n";
			cout << "      (╬▔^▔)╯ \n";
			op = 200;
			sum = 0;
			while(op --){
				getkey();
				GetCursorPos(&mousepos);
				getWindowsRect();
				sx+=(key[3]-key[2]);sy+=0.5f;
				if(key[0])
					if(collideY(x,y,cx,cy+2)!=-114514||inside(x,y+cy*0.8f,cx,cy*0.2f,mousepos.x,mousepos.y-2))
						sy=-15;
				y+=sy;
				if(inside(x,y+cy*0.8f,cx,cy*0.2f,mousepos.x,mousepos.y-2)){ y=mousepos.y-cy;sy=0; }
				int c=collideY(x,y,cx,cy);
				if(c!=-114514){ y=c;sy=0; }
				x+=sx;
				if(inside(x,y+cy*0.2f,cx,cy*0.6f,mousepos.x,mousepos.y)){
					if(x+cx/2>mousepos.x) x=mousepos.x;
					else x=mousepos.x-cx;
					if(key[0]){ sy=-15;sx=sx<0?10:-10; }else sx=0;
				}
				c=collideX(x,y,cx,cy);
				if(c!=-114514){
					x=c;
					if(key[0]){ sy=-15;sx=sx<0?10:-10; }else sx=0;
				}
				sx*=0.9f;
				cyy+=(key[1]*cy/2-cyy)*0.5f;
				SetWindowPos(hWnd,HWND_TOPMOST,x,y+cyy,cx,cy-cyy,SWP_SHOWWINDOW);
				Sleep(20);
			}
			now_f = -1;
			f = 1;
		}else if(opp >= 3){
//			now_f = 3;
			opp = 0;
			system("cls");
			cout << "\n";
			cout << "                    \n";
			cout << "       ╥﹏╥ \n";
			op = 30;
			sum ++;
			while(op --){
				getkey();
				GetCursorPos(&mousepos);
				getWindowsRect();
				sx+=(key[3]-key[2]);sy+=0.5f;
				if(key[0])
					if(collideY(x,y,cx,cy+2)!=-114514||inside(x,y+cy*0.8f,cx,cy*0.2f,mousepos.x,mousepos.y-2))
						sy=-15;
				y+=sy;
				if(inside(x,y+cy*0.8f,cx,cy*0.2f,mousepos.x,mousepos.y-2)){ y=mousepos.y-cy;sy=0; }
				int c=collideY(x,y,cx,cy);
				if(c!=-114514){ y=c;sy=0; }
				x+=sx;
				if(inside(x,y+cy*0.2f,cx,cy*0.6f,mousepos.x,mousepos.y)){
					if(x+cx/2>mousepos.x) x=mousepos.x;
					else x=mousepos.x-cx;
					if(key[0]){ sy=-15;sx=sx<0?10:-10; }else sx=0;
				}
				c=collideX(x,y,cx,cy);
				if(c!=-114514){
					x=c;
					if(key[0]){ sy=-15;sx=sx<0?10:-10; }else sx=0;
				}
				sx*=0.9f;
				cyy+=(key[1]*cy/2-cyy)*0.5f;
				SetWindowPos(hWnd,HWND_TOPMOST,x,y+cyy,cx,cy-cyy,SWP_SHOWWINDOW);
				Sleep(20);
			}
			now_f = -1;
			f = 1;
		}else if(y <= 200 && now_f != 1){
			now_f = 1;
			fff = 1;
			system("cls");
			cout << "\n";
			cout << "                    \n";
			cout << "       (._.`) \n";
		}else if(fff == 1 && now_f != 2 && y > 200 && y <= 300){
			now_f = 2;
			fff = 0;
			system("cls");
			cout << "\n";
			cout << "                    \n";
			cout << "       >﹏< \n";
		}else if(now_f == 2 && sy == 0){
//			now_f = 3;
			opp ++;
			if(opp == 1){
				system("cls");
				cout << "\n";
				cout << "                    \n";
				cout << "       ⊙﹏⊙ \n";
			}
		}else if(now_f == -1 && f == 1){
			now_f = -1;
			f = 0;
			system("cls");
			cout << "                    \n";
			cout << "                    \n";
			cout << "    O( ∩ _ ∩ )O    \n";
//			cout << "                    \n";
//			cout << "                    \n";
		//	cout << "                    \n";
		//	cout << "                    \n";
		//	cout << "                    \n";
		//	cout << "                    \n";
			cout << "                    ";
		}
		getkey();
		GetCursorPos(&mousepos);
		getWindowsRect();
		sx+=(key[3]-key[2]);sy+=0.5f;
		if(key[0])
			if(collideY(x,y,cx,cy+2)!=-114514||inside(x,y+cy*0.8f,cx,cy*0.2f,mousepos.x,mousepos.y-2))
				sy=-15;
		y+=sy;
		if(inside(x,y+cy*0.8f,cx,cy*0.2f,mousepos.x,mousepos.y-2)){ y=mousepos.y-cy;sy=0; }
		int c=collideY(x,y,cx,cy);
		if(c!=-114514){ y=c;sy=0; }
		x+=sx;
		if(inside(x,y+cy*0.2f,cx,cy*0.6f,mousepos.x,mousepos.y)){
			if(x+cx/2>mousepos.x) x=mousepos.x;
			else x=mousepos.x-cx;
			if(key[0]){ sy=-15;sx=sx<0?10:-10; }else sx=0;
		}
		c=collideX(x,y,cx,cy);
		if(c!=-114514){
			x=c;
			if(key[0]){ sy=-15;sx=sx<0?10:-10; }else sx=0;
		}
		sx*=0.9f;
		cyy+=(key[1]*cy/2-cyy)*0.5f;
		SetWindowPos(hWnd,HWND_TOPMOST,x,y+cyy,cx,cy-cyy,SWP_SHOWWINDOW);
		Sleep(20);
	}
	return 0;
}
P17101 [ICPC 2017 Qingdao R] Suffix
C++
#include<bits/stdc++.h>
#define int long long
#define endl '\n'
using namespace std;
string s[500005];
vector<unsigned int>hs[500005];
unsigned int pw[500005];
int a[500005],len,k;
unsigned int get_hs(int x,int y){
	int l=,r=;
	return hs[];
}
bool cmp(int x,int y){
	int l=0,r=len-max(x,y)+2;
	while(l+1<r){
		int mid=l+r>>1;
		if()
	}
}
void solve(){
	string ans;
	int n;
	cin>>n;
	for(int i=1;i<=n;i++){
		k=i;
		cin>>s[i];
		len=s[i].size();
		s[i]=" "+s[i];
		hs[i].push_back(0);
		for(int j=1;j<=len;j++){
			a[j]=j;
			int x=hs[i][j-1];
			hs[i].push_back(x*base+s[len-j+1]);
		}
		sort(a+1,a+len+1,cmp);
		ans+=s[i].substr(a[1]);
	}
}
signed main(){
	pw[0]=1;
	for(int i=1;i<=500000;i++){
		pw[i]=pw[i-1]*base;
	}
	int t;
	cin>>t;
	while(t--){
		solve();
	}
	return 0;
}