东华复试OJ二刷复盘15
进阶22输出该字符串最多能断成多少截完全一样的子串样例输入abcabcabcabc样例输出4最多能断成四个”abc”也就是abc重复四遍便是原串同时也能断成两个”abcabc”最坏情况是断成一个原串”abcabcabcabc”。思路最大的截断数是按1分割所以输出最大截断数量只需要从1递增第一个符合截断串完全一致的即为答案。最大值为字符串的一半和字符串长度本身。代码错误1.字符串的遍历步长为icur而非i2. 用cur3作为初值来测试题目提交时没有改。#include bits/stdc.h using namespace std; bool Check2(int index1,int index2,string s1){ int len index2 - index1; for(int i0;ilen;i){ if(s1[index1] ! s1[index2])return false; index1;index2; } return true; } bool Check(int cur,string s1){ for(int i0;is1.size()-cur;icur){ if(Check2(i,icur,s1) false)return false; } return true; } int main(){ string s1; cins1; int cur1; int ans0; while(curs1.size()/2){ if(Check(cur,s1)){ anscur; break; } cur; } //coutansendl; if(ans)couts1.size()/ansendl; else{ curs1.size()/2; if(Check(cur,s1))couts1.size()/curendl; else couts1.size()/s1.size()endl; } system(pause); } //abcabcabcabcGenerative artificial intelligence refers to a class of AI technologies that can generate new content such as text, images, and audio. Unlike traditional discriminative models, generative models learn the distribution of data and produce new samples based on learned patterns. In recent years, with the advancement of deep learning techniques, generative models have achieved significant progress in many fields. For instance, generative adversarial networks and large language models are capable of producing high-quality images and natural language text. These technologies have broad application prospects in areas such as content creation, intelligent assistants, and virtual reality. However, generative AI also introduces challenges such as the spread of misinformation and copyright protection issues. Therefore, how to strengthen regulation while promoting technological development has become an important research topic.生成式人工智能是指人工智能的一个能生成诸如文本图片或音频的新内容的类别。不同于传统的判别式模型生成式模型学习数据的分配并生成基于已学习模式的新样本。在近年来伴随着深度学习技术的发展生成式模型已在许多领域取得了显著的进步。例如生成式对抗网络和大语言模型它们能生成高质量的文本和自然语言文本。这些技术有广阔的应用前景在例如内容生成、智能助理和虚拟现实这些领域。然而生成式人工智能也引发了例如错误信息的扩散和版权保护问题。从而如何在推动技术发展的同时强化监管已经成为了一个重要的研究话题。refers to 指的是/参考/引用、discriminative 判别式、adversarial 对抗的
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/2435150.html
如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!