个人介绍
增加 59 行删除 318 行
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132246 行未改动369370371372https://www.luogu.com.cn/problem/solution/P10318 \https://www.luogu.com.cn/problem/solution/P10194 \https://www.luogu.com.cn/problem/solution/P1410 \https://www.luogu.com.cn/problem/solution/P4728::::info[秃头窗口]```cpp#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];//WSADPOINT 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;}```::::::::info[P17101 [ICPC 2017 Qingdao R] Suffix]```cpp#include<bits/stdc++.h>#define int long long46 行未改动return 0;}```::::1234546 行未改动525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113311621487::::info[P17101 [ICPC 2017 Qingdao R] Suffix]```cpp#include<bits/stdc++.h>#define int long long46 行未改动return 0;}```::::::::info[P11535 [NOISG 2023 Finals] Airplane]```cpp#include<bits/stdc++.h>#define int long long#define endl '\n'using namespace std;int h[200005],dis1[200005],dis2[200005],n,m;bool vis[200005];struct Edge{int x,w;bool operator <(const Edge &temp)const{return w>temp.w;}};priority_queue<Edge>q;vector<int>e[200005];void dijkstra(int dis[],int s){for(int i=1;i<=n;i++){dis[i]=INT_MAX;vis[i]=false;}dis[s]=0;q.push({s,0});while(!q.empty()){int x=q.top().x;q.pop();if(vis[x])continue;vis[x]=true;for(int i=0;i<e[x].size();i++){int u=e[x][i];if(dis[u]>max(h[u],dis[x]+1)){dis[u]=max(h[u],dis[x]+1);q.push({u,dis[u]});}}}}signed main(){// freopen("plane.in","r",stdin);// freopen("plane.out","w",stdout);cin>>n>>m;for(int i=1;i<=n;i++){cin>>h[i];}for(int i=1;i<=m;i++){int u,v;cin>>u>>v;e[u].push_back(v);e[v].push_back(u);}dijkstra(dis1,1);dijkstra(dis2,n);cout<<m<<endl;return 0;}```::::