摘要:
KMP字符串匹配算法 常见的 \(O(n*m)\) 暴力算法 for (int i=1;i<=n;i++){ int j,k; for (j=i,k=1;k<=m;j++,k++){ if (s1[j]!=s2[k]) break; } if (k==m) cout<<i; } 最外层用 \(i\) 阅读全文
posted @ 2025-03-28 17:32
才瓯
阅读(62)
评论(0)
推荐(0)
摘要:
牛客 小白112 20250326 https://ac.nowcoder.com/acm/contest/103957 A: 题目大意:天平一端有 \(w\) 重的物品,给定砝码 \(a,b\) 判断能否是天平平衡 #include<bits/stdc++.h> #define cintie io 阅读全文
posted @ 2025-03-28 17:30
才瓯
阅读(23)
评论(0)
推荐(0)
摘要:
牛客 周赛85 20250320 https://ac.nowcoder.com/acm/contest/103948 A: 题目大意:有 \(n\) 个石头,每次取走一个判断谁获胜 #include<bits/stdc++.h> #define cintie ios::sync_with_stdi 阅读全文
posted @ 2025-03-28 17:29
才瓯
阅读(18)
评论(0)
推荐(0)