摘要: A. +-x 模拟题 void solve(){ cin>>a>>b; cout<<max({a+b,a*b,a-b})<<endl; } B. One Clue 模拟题 void solve(){ cin>>k>>x; if(k==1){ cout<<x<<endl; return; } for( 阅读全文
posted @ 2025-03-13 00:11 shuying6 阅读(60) 评论(0) 推荐(0)
摘要: 1.1 链表 洛谷-P1996 约瑟夫问题 我就直接模拟 void solve() { cin>>n>>k; int id=0; for(int i=1;i<=n;i++){ int p=0; while(p<k){ bool f=false; while(vis[id]){ id++; f=1; 阅读全文
posted @ 2025-03-13 00:10 shuying6 阅读(71) 评论(0) 推荐(0)
摘要: title: 知识点系列——基本算法 date: 2025-02-20 00:00:00 tags: 知识点系列 2.2 尺取法 HDU-2029 Palindromes _easy version 回文数。 void solve() { cin>>s; string t=s; reverse(AL 阅读全文
posted @ 2025-03-13 00:09 shuying6 阅读(28) 评论(0) 推荐(0)
摘要: 2.5 2018A-Card Partition *1600 思维题 这道题就是简单的枚举,因为 $n$ 不大。因此就直接枚举每组分成多少张,这样就能算出组数了,这里的总数是把加的牌也算进去的,这样就是看最坏的情况下能否满足题目条件。 void solve(){ cin>>n>>k; int mx= 阅读全文
posted @ 2025-03-13 00:09 shuying6 阅读(148) 评论(0) 推荐(0)
摘要: A. Rearranging ABC 题意:求给定的字符串是不是 ABC。 思路:直接判断。 void solve(){ cin>>s; for(auto x:s){ S[x]++; } if(S['A']==1&&S['B']==1&&S['C']==1){ cout<<"Yes"<<endl; 阅读全文
posted @ 2025-03-13 00:08 shuying6 阅读(27) 评论(0) 推荐(0)