第一大节
第一小节
这是一句需要引用的话。1
给定一个长度为 n 的字符序列 a,初始时序列中全部都是字符 L。
有 q 次修改,每次给定一个 x,若 ax 为 L,则将 ax 修改成 R,否则将 ax 修改成 L。
11111111111111111111111111111111111111111111111111111111
11111111111111111111111111111111111111111111111111111
对于一个只含字符 L,R 的字符串 s,若其中不存在连续的 L 和 R,则称 s 满足要求。
每次修改后,请输出当前序列 a 中最长的满足要求的连续子串的长度。
%%{init: {'theme':'base', 'themeVariables': { 'primaryColor':'#E8F4F8','primaryTextColor':'#2C3E50','primaryBorderColor':'#5DADE2','lineColor':'#85C1E2','secondaryColor':'#F0F8FF','tertiaryColor':'#E8F8F5','fontSize':'14px'}}}%%
mindmap
root((密度链框架))
高输出质量
显著提高生成结果的流畅性和相关性
通过对提示的优化和生成内容的密度标准化
使输出更加精确
更好的控制
用户可以设定明确的目标
提供具体的示例来引导生成过程
使模型更好地满足用户需求
灵活性与适应性
适用于多种不同的任务和场景
通过调整输入提示和反馈机制
适应不同需求和灵活变化的环境
持续学习
通过反馈机制帮助模型不断学习
适应用户的偏好
长时间使用可逐渐提高输出质量graph LR
A(密度链框架)
A -- 高输出质量 --> B["通过对提示的优化和生成内容的密度标准化,可以显著提高生成结果的流畅性和相关性,从而使输出更加精确"];
A -- 更好的控制 --> C["用户可以通过设定明确的目标和提供具体的示例,来引导生成过程,使得模型能够更好地满足用户需求"];
A -- 灵活性与适应性 --> D["密度链框架能够适用于多种不同的任务和场景,通过调整输入提示和反馈机制,用户可以适应不同的需求和灵活变化的环境"];
A -- 持续学习 --> E["通过反馈机制,该框架能够帮助模型不断学习和<br>适应用户的偏好,使得长时间使用下来,<br>可以逐渐提高模型的输出质量"];
%% --- 样式定义 ---
%% 根节点样式
style A fill:#fff,stroke:#333,stroke-width:1.5px,rx:10px,padding:10px
%% 终端文本节点样式 (设置边框和背景为白色以模拟“无框”)
style B fill:#fff,stroke:#fff,color:#000
style C fill:#fff,stroke:#fff,color:#000
style D fill:#fff,stroke:#fff,color:#000
style E fill:#fff,stroke:#fff,color:#000
%% 连接线样式 (匹配颜色)
linkStyle 0 stroke:#9370DB,stroke-width:2px
linkStyle 1 stroke:#00BFFF,stroke-width:2px
linkStyle 2 stroke:#3CB371,stroke-width:2px
linkStyle 3 stroke:#FFD700,stroke-width:2pxgraph TD
A(密度链框架)
A -- 高输出质量 --> B["通过对提示的优化和生成内容的密度标准化,可以显著提高生成结果的流畅性和相关性,从而使输出更加精确"]
A -- 更好的控制 --> C["用户可以通过设定明确的目标和提供具体的示例,来引导生成过程,使得模型能够更好地满足用户需求"]
A -- 灵活性与适应性 --> D["密度链框架能够适用于多种不同的任务和场景,通过调整输入提示和反馈机制,用户可以适应不同的需求和灵活变化的环境"]
A -- 持续学习 --> E["通过反馈机制,该框架能够帮助模型不断学习和适应用户的偏好,使得长时间使用下来,可以逐渐提高模型的输出质量"]
%% --- 样式定义 ---
%% 根节点样式
style A fill:#fff,stroke:#333,stroke-width:1.5px,rx:10px,padding:10px
%% 终端文本节点样式
style B fill:#fff,stroke:#fff,color:#000
style C fill:#fff,stroke:#fff,color:#000
style D fill:#fff,stroke:#fff,color:#000
style E fill:#fff,stroke:#fff,color:#000
%% 连接线样式
linkStyle 0 stroke:#9370DB,stroke-width:2px
linkStyle 1 stroke:#00BFFF,stroke-width:2px
linkStyle 2 stroke:#3CB371,stroke-width:2px
linkStyle 3 stroke:#FFD700,stroke-width:2px%%{init:{
"theme":"base",
"themeVariables":{"background":"transparent"}, /* 主题背景透明 */
"themeCSS":".mermaid{background:transparent!important;} svg{background:transparent!important;}"
}}%%
flowchart LR
Start(("开始"))
Init["初始化<br/>空双端队列 dq<br/>结果数组 result<br/>i = 0"]
CheckLoop{"i < n?"}
CheckFront{"检查队头<br/>dq 非空且<br/>dq.front() <= i - k?"}
PopFront["从队头弹出<br/>dq.pop_front()"]
CheckBack{"维护队尾单调性<br/>dq 非空且<br/>nums[i] >=<br/>nums[dq.back()]?"}
PopBack["从队尾弹出<br/>dq.pop_back()"]
PushBack["新索引入队<br/>dq.push_back(i)"]
CheckWindow{"窗口已形成?<br/>(i >= k - 1)"}
RecordMax["记录窗口最大值<br/>result.push(nums[dq.front()])"]
Increment["i = i + 1"]
Return["返回结果数组<br/>result"]
End(("结束"))
Start --> Init
Init --> CheckLoop
CheckLoop -->|是| CheckFront
CheckLoop -->|否| Return
CheckFront -->|是| PopFront
PopFront --> CheckFront
CheckFront -->|否| CheckBack
CheckBack -->|是| PopBack
PopBack --> CheckBack
CheckBack -->|否| PushBack
PushBack --> CheckWindow
CheckWindow -->|是| RecordMax
RecordMax --> Increment
CheckWindow -->|否| Increment
Increment --> CheckLoop
Return --> End
style Init fill:#E1BEE7,stroke:#333,stroke-width:2px
style CheckLoop fill:#FFE0B2,stroke:#333,stroke-width:2px
style CheckFront fill:#FFE0B2,stroke:#333,stroke-width:2px
style PopFront fill:#F8BBD0,stroke:#333,stroke-width:2px
style CheckBack fill:#B3E5FC,stroke:#333,stroke-width:2px
style PopBack fill:#F8BBD0,stroke:#333,stroke-width:2px
style PushBack fill:#C8E6C9,stroke:#333,stroke-width:2px
style CheckWindow fill:#FFE0B2,stroke:#333,stroke-width:2px
style RecordMax fill:#B2EBF2,stroke:#333,stroke-width:2px
style Increment fill:#FFE0B2,stroke:#333,stroke-width:2px
style Return fill:#E1BEE7,stroke:#333,stroke-width:2px第二大节
人际关系的四种类型
-
幸福而稳定的
- 交往结果 > CL > Cla
- 交往结果 > CLalt > C
-
不幸福也不稳定的
- 交往结果 < CL < Cla
- 交往结果 < CLalt < C
-
不幸福但是稳定的
-
幸福但是不稳定的
第二小节
这是一句需要引用的话。2
参考资料:
- 张三.《某某研究》;链接:https://example.com
- 张三.《某某研究》;链接:https://example.com/abc
