跳到正文

CyohLink_X

1602324

AFO了||额...蒟蒻一枚||支持互关,想涨粉QWQ||记得私信

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

资料

编号
1602324
抓取

私信(支持互关)

DeepSeek

模拟

代码
™



0
1
2
3
4
5
0 2
0 4
0 5
1 4
1 5
2 3
2 4
4 5
1 3
3 4
5 2
5 3
0 1
2 1
3 0

不知道

小熊猫

般若 2

15928794937

tuyanke2012

洛谷小游戏

绘谜

概率游戏

好玩的卡牌游戏

般若

卡牌游戏2

qpqpqpqpqpqpqpqpqqpqpqpqpqpqpqpqpqppqpqpqpqpqpqpqpqpqqpqpqpqpqppqqpqpqp

https://www.yujianzx.com/chapter/61021/391530.html

C++
#include<bits/stdc++.h>//鼠标连点器
#include<windows.h>
using namespace std;
signed main() {
	int n;
	cout<<" 鼠标连点器使用说明:\n";
	cout<<" 1.按F2键开始,按F2键暂停,退出请按Esc。\n";
	cout<<" 2.输入毫秒时,一定输入大于50的数,否则电脑会爆!\n";
	system(" pause");
	cout<<" 你想每多少毫秒点击鼠标(1秒=1000毫秒)?\n";
	cin>>n;
	system("cls");
	while(1) {
		if(GetAsyncKeyState(VK_F2)) {
			while(1) {
				mouse_event(MOUSEEVENTF_LEFTDOWN|MOUSEEVENTF_LEFTUP,0,0,0,0);
				Sleep(n);
				if(GetAsyncKeyState(VK_F2)) break;
				if(GetAsyncKeyState(VK_ESCAPE)) return 0;
			}
		}
		if(GetAsyncKeyState(VK_ESCAPE)) return 0;
	}
	return 0;
}

不想写头文件的:

C++
#include<bits/stdc++.h>
#define int long long
using namespace std;
signed main(){
    ios::sync_with_stdio(false);
	cin.tie(0);cout.tie(0);
    return 0;
}

并查集:

C++
int find(int x){
	if(x!=f[x]){
		f[x]=find(f[x]);
	}
	return f[x];
}
void clx(int x,int y){
	int a=find(x),b=find(y);
	if(a!=b){
		f[b]=a;
	}
}

int 类型通常是4字节(32位),取值范围是 -2,147,483,648 (-2^31) 到 2,147,483,647 (2^31 - 1)。

long long通常最小值是-9223372036854775808(-2^63),最大值是9223372036854775807(2^63 - 1)。

float大约是1.2e-38到3.4e38之间的任何值

double类型提供了一个大约为10^-308到10^308的有效数值范围

C++
#include<bits/stdc++.h>
#define int long long
using namespace std;
int n,ans,x[200010],y[200010],xx,a[200010],b[200010];
signed main() {
    cin>>n;
    for(int i=1;i<=n;i++){
        cin>>xx;
        a[xx]=i;
        b[i]=xx;
    }
    for(int i=1;i<=n;i++){
        if(a[i]!=i){
            x[++ans]=i;
            y[ans]=a[i];
            ll xx=b[i];
            swap(b[a[i]],b[i]);
            swap(a[xx],a[i]);
        }
    }cout<<ans<<endl;
    for(int i=1;i<=ans;i++)cout<<x[i]<<" "<<y[i]<<endl;
    return 0;
}
C++
#include<bits/stdc++.h>
#include<windows.h>
using namespace std;
string s;
bool havekey,seekey,havebox=1,windowopen;
int day;
int main(){
	srand((unsigned)time(0));
	cout<<"密室逃脱游戏。\n";
	system("pause");
	cout<<"------------第一关------------";
	for(int i=1;i<=1000000000;i++)i+1-i+i*i;
	system("cls");
	cout<<"现在是一个宁静的夜晚,房间里就一扇门、一个柜子、一个小窗。\n";
	while(true){
		cin>>s;
		if(s=="开门"){
			if(havekey){
				system("cls");
				cout<<"逃脱成功!";
				for(int i=1;i<=1000000000;i++)i+1-i+i*i;
				break;
			}
			else cout<<"门是锁着的。";
		}
		else if(s=="打开柜子")cout<<"柜子里空空如也。";
		else if(s=="查看柜子底端"||s=="查看柜子底部")cout<<"发现了一个钥匙,但够不着。";
		else if(s=="推动柜子"||s=="移动柜子"){
			if((seekey||havekey)&&havebox)cout<<"柜子被推开。";
			else if(havebox){
				cout<<"柜子被推开,露出了底下的钥匙。";
				seekey=1;
			}
			else cout<<"指令错误,请重试";
		}
		else if(s=="拿钥匙"){
			if(seekey){
				seekey=0;
				havekey=1;
				cout<<"拿到钥匙。";
			}
			else cout<<"指令错误,请重试。";
		}
		else if(s=="开窗"){
			if(windowopen)cout<<"指令错误,请重试。";
			else{
				cout<<"窗被打开,吹来一股清凉的风。";
				windowopen=1;
			}
		}
		else if(s=="关窗"){
			if(!windowopen)cout<<"指令错误,请重试。";
			else{
				cout<<"窗被关闭。";
				windowopen=0;
			}
		}
		else if(s=="看向窗外"){
			if(day==0)cout<<"一片漆黑的夜空。";
			else if(day==1)cout<<"一朵白云正在窗外飘着。";
			else cout<<"夕阳斜照着大地。";
		}
		else if(s=="睡大觉"){
			if(day==0?rand()%2:rand()%3)cout<<"翻来覆去睡不着";
			else{
				cout<<"你进入了梦乡……\n";
				for(int i=1;i<=666666667;i++)i+1-i+i*i;
				cout<<"你醒来了,";
				day=(day+1)%3;
				if(day==1)cout<<"到早上了。";
				else if(day==2){
					cout<<"已经到下午了。";
					if(havebox){
						havebox=0;
						if(havekey||seekey)cout<<"\n但是柜子不见了。"; 
						else{
							cout<<"\n但是柜子不见了,底下的钥匙露出来了。";
							seekey=1;
						}
					}
				}
				else cout<<"又到晚上了。";
			}
		}
		else cout<<"指令错误,请重试。";
		cout<<endl;
	}
}

https://cdn.luogu.com.cn/upload/image_hosting/ctmzcyqs.png

共 1 篇
  1. 休闲·娱乐

    雨中觉醒

    操场上,两大高手对峙而立。 一方是人民校长张爱国,身着洗得发白的灰色中山装,眼神沉稳如山;另一方则是南山校长赵世坤,一身昂贵的黑色衣服,口袋里不断地掉落出金条和2025贫困生名单(2025富豪榜)。 “张校长,十年了,你还有存在的必要吗?”赵世坤缓缓摆出起手式,“看看你的学校,设…