- 分享
模板(游戏(可玩))
- 2024-8-13 18:59:24 @
#include <bits/stdc++.h>
#include<windows.h>
#include <unistd.h>
using namespace std;
#define endl '\n'
#define TRACE 1
#define tcout TRACE && cout
#define fst ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define KEY_DOWN(VK_NONAME) ((GetAsyncKeyState(VK_NONAME) & 0x8000) ? 1:0)
#define int long long
#define interesting long long
#define read(a) cin >> (a)
#define out(a) cout << (a) << endl;
#define all(a) (a).begin(),(a).end()
#define z_for_string(name, end) for(int name = 0; name < (end); i ++)
#define d_for_string(name, end) for(int name = (end); name > 0; i --)
#define z_rep(name, start, end) for(int name = (start); name <= (end); i ++)
#define d_rep(name, start, end) for(int name = (start); name >= (end); i --)
#define h_TRUE cout << "YES" << endl;
#define h_FALSE cout << "NO" << endl;
#define h_True cout << "Yes" << endl;
#define h_False cout << "No" << endl;
#define h_true cout << "yes" << endl;
#define h_false cout << "no" << endl;
#define k_TRUE cout << "YES" << " ";
#define k_FALSE cout << "NO" << " ";
#define k_True cout << "Yes" << " ";
#define k_False cout << "No" << " ";
#define k_true cout << "yes" << " ";
#define k_false cout << "no" << " ";
const int P = 998244353;
const int Base = 3221225477;
const int INF = 0x3f3f3f3f3f3f3f3f;
const int N = 1e6 + 10, M = 2e6 + 10;
const int Mod = 1e9+7;
int shi_er(int x) //10 - 2
{
if(x>1) return shi_er(x/2)*10+x%2;
else return x%2;
}
long long fastPower(long long base, long long power) //pow pro max
{
long long result = 1;
while (power > 0) {
if (power % 2 == 1) {
result = result * base % Mod;
}
power = power / 2;
base = (base * base) % Mod;
}
return result;
}
int gcd(int a,int b) //gcd
{
if(b==0) return a;
return gcd(b,a%b);
}
int lcm(int a,int b) //lcm
{
return a*b/gcd(a,b);
}
int isprime(int x) //质数
{
if(x==1||x%2==0&&x!=2)return false;
for(int i=3;i<=sqrt(x);i+=2)
{
if(x%i==0) return false;
}
return true;
}
string Itoa(int num,int R) //10 - max(36)
{
string str;
int rmd;
char ch;
if(num==0) str="0";
while(num>0) {
rmd=num%R;
ch=(rmd<10)?(rmd+'0'):(rmd-10+'A'); // 小于10表示为[0,9],否则减去10+'A'
str=ch+str;
num/=R;
}
if(str.size()==1) str="0"+str;
return str;
}
int Atoi(string s,int R) {
int res=0;
for(int i=0;i<s.size();i++) {
if(s[i]>='0' && s[i]<'9') {
res=res*R+s[i]-'0';
} else if(s[i]>='A' && s[i]<='Z') {
res=res*R+s[i]-'A'+10;
}
}
return res;
}
void code()
{
}
void tt()
{
int t;
read(t);
while (t --)
{
code();
}
}
signed main()
{
while(KEY_DOWN(MOUSE_EVENT) == false)
{
cout << "按下鼠标右键开始游戏" << endl;
}
while(1){
system("start cai!");
}
return 0;
}
/*
# 如何使用此模板?
endl 换行
TRACE 1
tcout cout
fst 快读快出
int long long
interesting long long
ll long long
read(a) 读入a
h_out(a) 换行输出 a 标准输出: cout << a << endl
k_out(a) 空格输出 a 标准输出: cout << a << " "
all(a) a 的从开始到结束的所有字符遍历
z_for_string(name, end) 从 0 开始正着输出
d_for_string(name, end) 从 end 开始倒着输出
z_rep(name, start, end) 正着从 start 开始循环到 end 结束
d_rep(name, start, end) 倒着从 start 开始循环到 end 结束
h_TRUE 换行输出 YES 标准输出: cout << "YES" << endl
h_FALSE 换行输出 NO 标准输出: cout << "NO" << endl
h_True 换行输出 Yes 标准输出: cout << "Yes" << endl
h_False 换行输出 No 标准输出: cout << "No" << endl
h_true 换行输出 yes 标准输出: cout << "yes" << endl
h_false 换行输出 no 标准输出: cout << "no" << endl
d_TRUE 空格输出 YES 标准输出: cout << "YES" << " "
d_FALSE 空格输出 NO 标准输出: cout << "NO" << " "
d_True 空格输出 Yes 标准输出: cout << "Yes" <<" "
d_False 空格输出 No 标准输出: cout << "No" << " "
d_true 空格输出 yes 标准输出: cout << "yes" << " "
d_false 空格输出 no 标准输出: cout << "no" <<" "
P 取余常用数: 998244353
Base 3221225477
INF 无限大
N 数组常用值: 1e6 + 10
M 数组常用值: 2e6 + 10
Mod 1e9+7
shi_er(x) 十进制x,转二进制
fastPower(base, power) 快速幂函数
gcd(a, b) gcd(最大公约数)
lcm(a, b) lcm(最小公倍数)
isprime(x) 判断质数
Itoa(num, R) 十进制num转R进制(max(R=36))
Atoi(s, R) R进制s转十进制
code()+tt cf800常用模板
*/
0 comments
No comments so far...