const{createApp}=Vue const{createVuetify,useGoTo,useDisplay}=Vuetify var data={alert:{show:false,color:'success',text:'',timeout:0,},theme:{dark:false,},nav:{showDrawer:false,showTOC:true,tocPanel:0,tab:'account',post:{discussionId:3659,currentPage:1,targetPage:1,total:11,anchor:0,goToOptions:{container:null,duration:0,easing:'easeInOutCubic',offset:-100,},worker:null,task:[],active:[],apiLock:[],originLike:new Map([]),},related:{block:1,}},search:{width:80,text:null,loading:false,},tags:[{id:46,url:'/t/1605781d6a045c73667750031923',name:'GPT',color:'#66BB6A',icon:'mdi-tag-heart',},{id:59,url:'/t/3613550e6a045c7269770b181038',name:'Claude',color:'#66BB6A',icon:'mdi-tag-heart',},{id:64,url:'/t/693157086a045c7164772a383a3c',name:'Grok',color:'#66BB6A',icon:'mdi-tag-heart',},],posts:[{id:42416,num:0,uid:9108,content:'\u003Cp\u003E不限量拼车200美刀gptpro赠送gptplus claudepro grok3\u003Cbr\u003E三大隔离面板协同使用 不降智 体验感超级棒\u003Cbr\u003E感谢论坛提供拼车板块,此福利拼车仅面向论坛的老铁\u003Cbr\u003E体验地址:https://chatshare.xyz\u003C/p\u003E\u003Cp\u003E登录账户:nodeseek2025\u003Cbr\u003E登录密码:12345678\u003C/p\u003E',ipRegion:'',updatedByUid:0,createdAt:'2025-03-14 12:39:40',updatedAt:'2025-03-17 14:40:02',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:42417,num:1,uid:1579,content:'\u003Cp\u003E用户不存在,是被改密码了吗哈哈\u003C/p\u003E',ipRegion:'',updatedByUid:0,createdAt:'2025-03-14 12:41:15',updatedAt:'2025-03-17 14:40:02',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:42418,num:2,uid:9108,content:'\u003Cp\u003E再试一下呢,你试的时候可能是刚开,截止到3点\u003C/p\u003E',ipRegion:'',updatedByUid:0,createdAt:'2025-03-14 12:49:29',updatedAt:'2025-03-17 14:40:02',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:42419,num:3,uid:9781,content:'\u003Cp\u003E网站打不开\u003C/p\u003E',ipRegion:'',updatedByUid:0,createdAt:'2025-03-14 12:50:49',updatedAt:'2025-03-17 14:40:02',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:42420,num:4,uid:1579,content:'\u003Cp\u003E\u003Cimg src\u003D\"https://img.933332.xyz/i/2025/03/14/67d3b5f5ab2bf.webp\" alt\u003D\"image.webp\"\u003E\u003Cbr\u003E\u003C/p\u003E',ipRegion:'',updatedByUid:0,createdAt:'2025-03-14 12:52:08',updatedAt:'2025-03-17 14:40:02',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:42421,num:5,uid:9108,content:'\u003Cp\u003E 刷新一下试\u003C/p\u003E',ipRegion:'',updatedByUid:0,createdAt:'2025-03-14 12:56:37',updatedAt:'2025-03-17 14:40:02',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:42422,num:6,uid:9108,content:'\u003Cp\u003E 密码改成了12345678\u003C/p\u003E',ipRegion:'',updatedByUid:0,createdAt:'2025-03-14 12:57:23',updatedAt:'2025-03-17 14:40:02',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:42423,num:7,uid:5356,content:'\u003Cp\u003E有点好奇 这个换车之后 聊天记录还能继续保存 是怎么做到的\u003C/p\u003E',ipRegion:'',updatedByUid:0,createdAt:'2025-03-14 13:02:29',updatedAt:'2025-03-17 14:40:02',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:42424,num:8,uid:9108,content:'\u003Cp\u003E 对话漫游\u003C/p\u003E',ipRegion:'',updatedByUid:0,createdAt:'2025-03-14 13:06:43',updatedAt:'2025-03-17 14:40:02',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:42425,num:9,uid:1579,content:'\u003Cp\u003E彩虹岛上有不到100只独角兽,每只独角兽的颜色不是绿色就是黄色。 每当午夜钟声响起的时候,一些独角兽会改变颜色:昨天,黄色独角兽与绿色独角兽的数量之比为5:6;今天,黄色独角兽与绿色独角兽的数量之比为4:3。\u003C/p\u003E\u003Cp\u003E请问:半夜改变颜色的独角兽的最多可能有多少只?\u003C/p\u003E\u003Cp\u003E帮忙问一下,看看哪个模型能解出来吗\u003C/p\u003E',ipRegion:'',updatedByUid:0,createdAt:'2025-03-14 13:07:13',updatedAt:'2025-03-17 14:40:02',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:42426,num:10,uid:9782,content:'\u003Cp\u003Ecluade3.7 :让我通过分析来解决这个问题。\u003Cbr\u003E首先整理已知信息:\u003C/p\u003E\u003Cp\u003E彩虹岛上有不到100只独角兽,颜色只有绿色或黄色\u003Cbr\u003E昨天,黄色:绿色 \u003D 5:6\u003Cbr\u003E今天,黄色:绿色 \u003D 4:3\u003Cbr\u003E午夜时刻,一些独角兽改变颜色\u003Cbr\u003E求改变颜色的独角兽最多可能有多少只\u003C/p\u003E\u003Cp\u003E我先设总独角兽数为n,然后计算昨天和今天的黄色和绿色独角兽数量。\u003Cbr\u003E昨天:\u003C/p\u003E\u003Cp\u003E黄色独角兽 \u003D 5k\u003Cbr\u003E绿色独角兽 \u003D 6k\u003Cbr\u003E总数 n \u003D 5k + 6k \u003D 11k\u003C/p\u003E\u003Cp\u003E今天:\u003C/p\u003E\u003Cp\u003E黄色独角兽 \u003D 4m\u003Cbr\u003E绿色独角兽 \u003D 3m\u003Cbr\u003E总数 n \u003D 4m + 3m \u003D 7m\u003C/p\u003E\u003Cp\u003E由于总数相同,所以 11k \u003D 7m,求最小的k和m使等式成立,得k \u003D 7,m \u003D 11。\u003Cbr\u003E因此:\u003C/p\u003E\u003Cp\u003E昨天:黄色独角兽 \u003D 5 × 7 \u003D 35只,绿色独角兽 \u003D 6 × 7 \u003D 42只\u003Cbr\u003E今天:黄色独角兽 \u003D 4 × 11 \u003D 44只,绿色独角兽 \u003D 3 × 11 \u003D 33只\u003Cbr\u003E总数 n \u003D 35 + 42 \u003D 44 + 33 \u003D 77只\u003C/p\u003E\u003Cp\u003E现在计算颜色变化的情况:\u003C/p\u003E\u003Cp\u003E黄色变为绿色的独角兽数量:设为x\u003Cbr\u003E绿色变为黄色的独角兽数量:设为y\u003C/p\u003E\u003Cp\u003E根据数量变化关系:\u003Cbr\u003E35 - x + y \u003D 44 (今天的黄色独角兽)\u003Cbr\u003E42 - y + x \u003D 33 (今天的绿色独角兽)\u003Cbr\u003E解这个方程组:\u003Cbr\u003E从第二个方程得 x - y \u003D 42 - 33 \u003D 9\u003Cbr\u003E代入第一个方程 35 - x + y \u003D 44\u003Cbr\u003E35 - (y + 9) + y \u003D 44\u003Cbr\u003E35 - 9 + 0 \u003D 44\u003Cbr\u003E26 \u003D 44 (不成立)\u003Cbr\u003E这说明我的设置有问题。让我重新思考。\u003Cbr\u003E正确的方程应该是:\u003Cbr\u003E35 - x + y \u003D 44 (今天的黄色独角兽)\u003Cbr\u003E42 - y + x \u003D 33 (今天的绿色独角兽)\u003Cbr\u003E从第一个方程得:y - x \u003D 44 - 35 \u003D 9\u003Cbr\u003E从第二个方程得:x - y \u003D 42 - 33 \u003D 9\u003Cbr\u003E这两个等式相矛盾(y - x \u003D 9 和 x - y \u003D 9),说明我需要仔细检查计算。\u003Cbr\u003E让我重新分析这个问题:\u003Cbr\u003E昨天:\u003C/p\u003E\u003Cp\u003E设黄色独角兽数量为y₁,绿色为g₁\u003Cbr\u003Ey₁:g₁ \u003D 5:6\u003Cbr\u003Ey₁ \u003D 5k,g₁ \u003D 6k(k为正整数)\u003Cbr\u003E总数 n \u003D y₁ + g₁ \u003D 11k\u003C/p\u003E\u003Cp\u003E今天:\u003C/p\u003E\u003Cp\u003E设黄色独角兽数量为y₂,绿色为g₂\u003Cbr\u003Ey₂:g₂ \u003D 4:3\u003Cbr\u003Ey₂ \u003D 4m,g₂ \u003D 3m(m为正整数)\u003Cbr\u003E总数 n \u003D y₂ + g₂ \u003D 7m\u003C/p\u003E\u003Cp\u003E由于总数相同,有11k \u003D 7m,最小解为k \u003D 7,m \u003D 11\u003Cbr\u003E所以:\u003C/p\u003E\u003Cp\u003E昨天:黄色 \u003D 35只,绿色 \u003D 42只\u003Cbr\u003E今天:黄色 \u003D 44只,绿色 \u003D 33只\u003C/p\u003E\u003Cp\u003E设从黄变绿的数量为a,从绿变黄的数量为b,则:\u003Cbr\u003Ey₂ \u003D y₁ - a + b \u003D 35 - a + b \u003D 44\u003Cbr\u003Eg₂ \u003D g₁ - b + a \u003D 42 - b + a \u003D 33\u003Cbr\u003E从第一个方程:b - a \u003D 9\u003Cbr\u003E从第二个方程:a - b \u003D 9\u003Cbr\u003E这两个等式确实矛盾,说明我的分析有误。\u003Cbr\u003E让我从另一个角度思考。如果有a只黄色独角兽变成绿色,有b只绿色独角兽变成黄色,则:\u003C/p\u003E\u003Cp\u003E黄色独角兽数量变化:35 - a + b \u003D 44\u003Cbr\u003E绿色独角兽数量变化:42 - b + a \u003D 33\u003C/p\u003E\u003Cp\u003E整理得:\u003C/p\u003E\u003Cp\u003Eb - a \u003D 9\u003Cbr\u003Ea - b \u003D -9\u003C/p\u003E\u003Cp\u003E现在两个方程一致了。\u003Cbr\u003E解得:b - a \u003D 9\u003Cbr\u003E我们要求改变颜色的独角兽最多可能有多少只,即a + b的最大值。\u003Cbr\u003E由于a和b都不能超过各自颜色的初始数量,即:\u003C/p\u003E\u003Cp\u003Ea ≤ 35(黄变绿的数量不能超过初始黄色数量)\u003Cbr\u003Eb ≤ 42(绿变黄的数量不能超过初始绿色数量)\u003C/p\u003E\u003Cp\u003E结合b - a \u003D 9,得a \u003D b - 9\u003Cbr\u003E要使a + b最大,需要b取最大值42,则a \u003D 42 - 9 \u003D 33\u003Cbr\u003E所以a + b \u003D 33 + 42 \u003D 75\u003Cbr\u003E但这不可能,因为这意味着所有独角兽都改变了颜色,不符合题意。\u003Cbr\u003E正确的约束应该是:\u003C/p\u003E\u003Cp\u003Ea ≤ 35(黄变绿的数量不能超过初始黄色数量)\u003Cbr\u003Eb ≤ 42(绿变黄的数量不能超过初始绿色数量)\u003Cbr\u003Ea ≥ 0,b ≥ 0(变化数量非负)\u003C/p\u003E\u003Cp\u003E结合b - a \u003D 9,当b取最大值42时,a \u003D 33,这是合理的。\u003Cbr\u003E因此,改变颜色的独角兽最多有a + b \u003D 33 + 42 \u003D 75只。\u003C/p\u003E',ipRegion:'',updatedByUid:0,createdAt:'2025-03-14 13:14:14',updatedAt:'2025-03-17 14:40:02',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},],usersMap:new Map([[9782,{uid:9782,url:'/u/321d77096a045c7e6762546f3b3c3717',avatar:'/a/321d77096a045c7e6762546f3b3c3717',username:'lukea🤖',}],[9781,{uid:9781,url:'/u/1f25040e6a045c7e6762576f32000113',avatar:'/a/1f25040e6a045c7e6762576f32000113',username:'mztkf🤖',}],[9108,{uid:9108,url:'/u/1e007e376a045c7e616a5e6f42251875',avatar:'/a/1e007e376a045c7e616a5e6f42251875',username:'lilong8879🤖',}],[1579,{uid:1579,url:'/u/23117d156a045c76656d5f6f05241e0d',avatar:'/a/23117d156a045c76656d5f6f05241e0d',username:'grys2012🤖',}],[5356,{uid:5356,url:'/u/2c2656236a045c72636f506f2218193f',avatar:'/a/2c2656236a045c72636f506f2218193f',username:'lydroger🤖',}],]),related:[{title:'基于 GPT 4o 开发完成了具有吉卜力、3D 版等多风格图片生成器,之前太忙改程序,才来分享',url:'/d/630e77046a045c77606a567a4458646a1e103560',},{title:'ChatGPT、Grok 复制回答结果到 Word 经常格式会乱掉,尤其是表格,有没有现成的工具能一键导出到 Word?',url:'/d/383f68546a045c77606a567a45506b6a18306011',},{title:'整理了一份《GPT-4o 生图大全》',url:'/d/0e267b0f6a045c77606a567a4650666a39193007',},{title:'Grok API 充 $5 终身每月获得 150 美元 API 额度',url:'/d/0c71452a6a045c77606a567a465c606a3d2e2233',},{title:'chatgpt 安卓无法使用',url:'/d/332d762c6a045c77606a567a475d676a2f0c1815',},{title:'Claude 依然是编程最强, ChatGPT 跟 Gemini 在 Bash 这种常见语言的最基础的地方依然犯错',url:'/d/35316b0b6a045c77606a56754f5e606a347a0666',},{title:'claude 免费用户和 20 美元付费用户分别一天可以提问 3.7 多少次',url:'/d/3c04762f6a045c77606a56754f5f666a15012119',},{title:'Grok3 已支持 API 调用',url:'/d/132a5f546a045c77606a56754f5d656a24302700',},{title:'GPT-4o 多模态生图有按次收费的不?',url:'/d/287079286a045c77606a56754f5a616a047b1105',},{title:'请教一下',url:'/d/62256a2f6a045c77606a567540506a6a5b0e651b',},{title:'基于 GPT-4o 搓了一个的图片生成器,帮助自己实现嘴图自由',url:'/d/021a431a6a045c77606a56754550606a14213e18',},{title:'职业焦虑发作以后找 ChatGPT 谈心,发现 4o 的回答比之前更有人情味了',url:'/d/6b13765b6a045c77606a5675455d636a3e006033',},{title:'gpt pro感觉还没用就没4.5了。',url:'/d/0d3d7c5d6a045c77606a56754658656a3d2b1408',},{title:'第一个完全用 AI 工具生成的工具站',url:'/d/6a18771a6a045c77606a5675475e616a01126104',},{title:'Apple Intelligence 无法绑定 ChatGPT',url:'/d/631e613e6a045c77606a5675475d606a3f221a31',},{title:'体验了一把 Vibe Coding, 用 Cursor + Claude3.7 sonnet 10 小时 0 代码搞定一个 MCP Servers\u0026amp;Clients 信息导航站',url:'/d/0f3d46216a045c77606a56754758606a2e766b35',},{title:'GPT-4o 生成吉卜力风格漫画',url:'/d/1c074a546a045c77606a56744e506b6a3e122a3f',},{title:'ChatGPT 要支持 MCP 了',url:'/d/621c61066a045c77606a5674405e6a6a2f112418',},{title:'ChatGPT 设计?',url:'/d/221f47146a045c77606a5674405e636a001a621e',},{title:'【已解决】CHATGPT APP 提示 PlayIntegrity verification failed,有大佬知道咋解决吗',url:'/d/1c78070e6a045c77606a5674405b626a3e171a66',},],} const App={setup(){const goTo=useGoTo() const{mdAndUp}=useDisplay() return{goTo,mdAndUp}},data(){return data;},mounted(){const themeDark=localStorage.getItem("themeDark") if(themeDark!==null){this.theme.dark=JSON.parse(themeDark)} if(this.nav.post.total>(this.nav.post.currentPage-1)*100+20){let moreLen=100 if(this.nav.post.total({id:null,num:(this.nav.post.currentPage-1)*100+v,uid:null,content:null,ipRegion:null,updatedByUid:null,createdAt:null,updatedAt:null,mentionNum:null,mentionedBy:null,mentionUsers:null,likeUsers:null,})) this.posts.push(...morePosts.slice(20))} this.workerStart() const hash=window.location.hash const match=hash.match(/#(\d+)/) if(match){const n=parseInt(match[1],10) if(n>=(this.nav.post.currentPage-1)*100&&n{this.jumpTo(n)})}} this.$nextTick(()=>{this.addHeadingIds() tocbot.init({tocSelector:'.toc',contentSelector:'#post-content-0',headingSelector:'h2, h3, h4',headingsOffset:100,scrollSmoothOffset:-100,scrollSmooth:true,collapseDepth:6,onClick:function(e){setTimeout(()=>{history.replaceState(null,'',window.location.pathname+window.location.search)},0)},}) tocbot.refresh()});},beforeUnmount(){this.workerStop() if(this.quill){this.quill.destroy() this.quill=null}},computed:{dposts(){return this.posts.slice(20);},},created(){},methods:{successAlert(msg){this.alert={show:true,color:'success',text:msg,timeout:1500,}},failureAlert(msg){this.alert={show:true,color:'error',text:msg,timeout:5000,}},flipThemeDark(){this.theme.dark=!this.theme.dark localStorage.setItem("themeDark",JSON.stringify(this.theme.dark))},toSearch(){if(!this.search.text){this.failureAlert('搜索词不能为空') return} let keywords=this.search.text.trim() if(keywords.length<1){this.failureAlert('搜索词不能为空') return} if(keywords.length>100){this.failureAlert('搜索词过长') return} this.doSearch(keywords)},toReg(){window.location.href="/reg"},toLogin(){window.location.href="/login"},toPage(){let url=window.location.href url=url.replace(/(\/\d+)?(#[0-9]+)?$/,this.nav.post.targetPage>1?`/${this.nav.post.targetPage}`:'') window.location.href=url},toLoadRelated({done}){if(this.my&&this.my.uid){this.apiLoadRelated({done})}else{done('ok')}},workerStart(){this.nav.post.worker=setInterval(()=>{this.workerLoad()},500);},workerStop(){if(this.nav.post.worker){clearInterval(this.nav.post.worker);this.nav.post.worker=null;}},async jumpTo(num){const page=Math.floor(num/100)+1 const i=num-(page-1)*100 if(page===this.nav.post.currentPage){this.goTo("#post-"+num,this.nav.post.goToOptions) if(!this.posts[i].id){const block=Math.floor(num/20)+1 this.nav.post.apiLock[block]=true await this.apiLoadPosts(block) this.$nextTick(()=>{this.goTo("#post-"+num,this.nav.post.goToOptions)})}}else{let url=window.location.href url=url.replace(/(\/\d+)?(#[0-9]+)?$/,page>1?`/${page}`:'') url=url+"#"+num window.location.href=url}},postIntersect(num){return(isIntersecting,entries,observer)=>{if(isIntersecting){this.nav.post.task.push(num) this.nav.post.active.push(num) this.nav.post.active=this.nav.post.active.filter(item=>Math.abs(item-num)<=5) this.nav.post.active.sort((a,b)=>a-b)}else{this.nav.post.active=this.nav.post.active.filter(item=>item!==num)} if(this.nav.post.active[0]){this.nav.post.anchor=this.nav.post.active[0]}else{this.nav.post.anchor=0}}},async apiLoadPosts(block){try{const response=await axios.post('/fapi/v1/post/block/'+block,{discussionId:this.nav.post.discussionId,}) if(response.data.code===0){response.data.data.posts.forEach(post=>{const i=post.num%100 Object.assign(this.posts[i],post)}) response.data.data.users.forEach(user=>{this.usersMap.set(user.uid,user)})}else{this.failureAlert('回帖数据加载失败: '+response.data.msg)}}catch(error){this.failureAlert('回帖数据加载失败: '+error)} this.nav.post.apiLock[block]=false},workerLoad(){while(this.nav.post.task.length){const num=this.nav.post.task.pop() const i=num-(this.nav.post.currentPage-1)*100 if(!this.posts[i].id){const block=Math.floor(num/20)+1 if(!this.nav.post.apiLock[block]){this.nav.post.apiLock[block]=true this.apiLoadPosts(block)}}}},getTimeInfo(t){if(!t){return ""} const now=new Date();const then=new Date(t);const diff=now-then;const minute=60*1000;const hour=minute*60;const day=hour*24;const month=day*30;const year=month*12;if(diffpost.num===num) if(!post){return "#"+num} const uid=post.uid const username=this.usersMap.get(uid)?.username if(!username){return "#"+num} return username},getUsernameByPostId(id){const post=this.posts.find(post=>post.id===id) if(!post){return "#"+this.getPostNumByPostId(id)} const uid=post.uid const username=this.usersMap.get(uid).username if(!username){return "#"+this.getPostNumByPostId(id)} return username},getPostNumByPostId(id){const post=this.posts.find(post=>post.id===id) return post.num},getPostById(id){const post=this.posts.find(post=>post.id===id) return post},getPostByNum(num){const post=this.posts.find(post=>post.num===num) return post},getAvatarByUid(uid){const avatar=this.usersMap.get(uid)?.avatar if(!avatar){return this.getRandomAvatar()} return avatar},getAvatarByPostNum(num){const post=this.posts.find(post=>post.num===num) if(!post){return this.getRandomAvatar()} const uid=post.uid return this.getAvatarByUid(uid)},getRandomAvatar(){const num=Math.floor(Math.random()*100) return "https://randomuser.me/api/portraits/men/"+num+".jpg"},getUrlByUid(uid){const url=this.usersMap.get(uid)?.url if(!url){return ""} return url},getTextByPostNum(num){const post=this.posts.find(post=>post.num===num) if(!post||!post.content){return '点击跳转到#'+num+'查看'} const parser=new DOMParser() const doc=parser.parseFromString(post.content,'text/html') const text=doc.body.textContent||'' return text.slice(0,100)},addHeadingIds(){const content=document.getElementById('post-content-0') if(!content){this.nav.showTOC=false return} const headings=content.querySelectorAll('h2, h3, h4') headings.forEach((heading,index)=>{if(!heading.id){heading.id=`toc-nav-${index}`}}) if(headings.length==0){this.nav.showTOC=false}},async doSearch(keywords){this.search.loading=true try{const response=await axios.post('/fapi/v1/search',{keywords:keywords,}) if(response.data.code===0){if(response.data.data.hash&&response.data.data.hash.length===32){window.location.href="/s/"+response.data.data.hash}else{this.failureAlert('搜索失败: 搜索服务异常')}}else{this.failureAlert('搜索失败: '+response.data.msg)}}catch(error){this.failureAlert('搜索失败: '+error)} this.search.loading=false},debounce(fn,delay){let timer=null return function(...args){if(timer)clearTimeout(timer) timer=setTimeout(()=>{fn.apply(this,args)},delay);};},},watch:{'nav.post.targetPage':{handler:async function(newV,oldV){this.toPage()},immediate:false},},} const vuetify=createVuetify({defaults:{global:{ripple:true,},},}) const app=createApp(App) app.use(vuetify).mount("#app")