2024年11月26日 六级勾祭
一些有用的软件/网站 1. 画图软件|2. ChatGPT|3. 成外信息网站|4. 莞外信息网站
以下是剪贴板
快读快写
#include <bits/stdc++.h>
#define I using
#define love namespace
#define wyw std
I love wyw;
#define ENDL putchar('\n')
#define SPACE putchar(' ')
inline long long read()
{
long long x = 0;
char c = getchar();
int f = 1;
while(!isdigit(c))
{
if (c == '-')
f = -f;
c = getchar();
}
while(isdigit(c))
{
x = (x << 3) + (x << 1) + c - 48;
c = getchar();
}
return x * f;
}
inline void write(long long x)
{
if (x < 0)
putchar('-'), x = -x;
if (x > 9)
write(x / 10);
putchar(x % 10 + '0');
return;
}
long long n, m;
int main()
{
}#include <bits/stdc++.h>
#define I using
#define love namespace
#define wyw std
I love wyw;
long long read()
{
long long x = 0;
char c = getchar();
int f = 1;
while(!isdigit(c))
{
if (c == '-')
f = -f;
c = getchar();
}
while(isdigit(c))
{
x = (x << 3) + (x << 1) + c - 48;
c = getchar();
}
return x * f;
}
struct node
{
node *lef, *rig;
long long l, r, sum;
}*root;
long long n, m, op, x, y, k;
void push_up(node *root)
{
root->sum = 0;
if (root->lef == NULL)
root->sum += (root->l + ((root->l + root->r) >> 1)) * (((root->l + root->r) >> 1) - root->l + 1) / 2;
else
root->sum += root->lef->sum;
if (root->rig == NULL)
root->sum += (((root->l + root->r) >> 1) + 1 + root->r) * (root->r - (((root->l + root->r) >> 1) + 1) + 1) / 2;
else
root->sum += root->rig->sum;
return;
}
void push_down(node *root)
{
if (root->lef == NULL)
{
root->lef = new node;
root->lef->sum = (root->l + ((root->l + root->r) >> 1)) * (((root->l + root->r) >> 1) - root->l + 1) / 2;
root->lef->l = root->l;
root->lef->r = ((root->l + root->r) >> 1);
}
else
root->sum += root->lef->sum;
if (root->rig == NULL)
root->sum += (((root->l + root->r) >> 1) + 1 + root->r) * (root->r - (((root->l + root->r) >> 1) + 1) + 1) / 2;
else
root->sum += root->rig->sum;
}
int main()
{
n = read();
m = read();
root = new node;
root->lef = root->rig = NULL;
root->l = 1;
root->r = 1000000000ll;
root->sum = 500000000500000000ll;
while(m--)
{
op = read();
x = read();
y = read();
switch(op)
{
case 1:
{
k = read();
update(root, l, r, k);
break;
}
}
}
}快读快输
\10.153.8.250 19801191902 Jing010106
四套算法题完整题面整理(t1/t2/t3/t4)
t1 字符串序列计数
题意
-
排序规则:对字符串序列执行冒泡排序,交换规则为:比较两项字符串首字符字典序,若前一项首字符字典序严格大于后一项首字符,则交换两者。
-
给定目标拼接字符串,求有多少本质不同的原始字符串序列,满足:将该序列按上述冒泡排序规则排序后,把序列所有字符串依次拼接,结果等于目标字符串。
-
输出要求:答案对 998244353 取模。
数据范围
(n 代表序列中字符串的数量)
t2 子集比值约束最小实数t
题意
给定无重复正整数集合,设集合大小为 n。 要求找到最小实数 t,满足:集合中任意一个大小为 m 的子集,都能在该子集内找到两个不同元素 x,y,使得 最终答案 t 需要以分数形式输出,无需取模。
数据范围
t3 数论变换数列前缀最值统计
前置定义
给定常数 x,y,定义变换函数:
对任意数字 ,可执行任意次操作:;
定义单个数列的答案为:对数列内每个元素任意次变换后,数列能达到的不同数值个数的最小值。
题意
给定数列 a、常数 x,y,依次求出 a 的每一个前缀对应的答案。
输出要求
每个前缀答案均对 998244353 取模。
数据范围
t4 鱼决斗存活概率
题意
初始有 n 条鱼,会发生 n-1 次决斗,直到只剩1条鱼。
-
每次决斗规则:从当前所有存活的鱼里等概率随机选两条决斗;
-
决斗胜负概率:两条鱼质量为 x,y,
◦ x 获胜概率:
◦ y 获胜概率:
3. 决斗后:胜者吃掉败者,自身质量更新为 x+y;败者消失。
输出要求
对每一条初始的鱼,分别输出它最终存活到最后的概率,概率以模 998244353 意义下的分数(逆元)形式输出。
数据范围
,输入给出每条鱼的初始质量 补充说明
t5 题目描述缺失,无有效题面信息。