摘要: E - Digit Products 点击查看代码 map<int,int>f[20]; void solve(){ int n,k;cin>>n>>k; auto s=to_string(n); int m=s.size(); function<int(int,int,int,int)>dfs=[ 阅读全文
posted @ 2024-04-28 17:35 archer2333 阅读(18) 评论(0) 推荐(0)
摘要: 发现二分答案有点弱 补点二分答案的题 阅读全文
posted @ 2024-04-07 14:48 archer2333 阅读(14) 评论(0) 推荐(0)
摘要: E - Rush Hour 2 设函数f(t)=t+ci+di/(t+1); 易得当t=sqrt(di)-1时取最小 所以根据时间来做dij 当时间大于sqrt(di)-1时直接加入即可 同时用并查集来查看1和n是否联通即可 ac code: 点击查看代码 #include<bits/stdc++. 阅读全文
posted @ 2024-04-07 14:08 archer2333 阅读(33) 评论(0) 推荐(0)
摘要: D - aab aba baa 根据题意 从左往右进行分析 如果当前该字母为a 那么存在两种情况 一种为b的数量为0 一种为剩余的k的数量小于右边所有情况的总和 其总和对应为C(剩余的长度,b的个数) 反之则为b 点击查看代码 int get(int x,int y){ int ans=1; for 阅读全文
posted @ 2024-04-06 19:50 archer2333 阅读(11) 评论(0) 推荐(0)
摘要: 失误好大日了 D-小A的线段(easy version) 先一维差分然后 枚举子集进行判断 E-小A的任务 通过优先队列进行B内的每个元素排序 如果长度满足情况 就判断是否为最小 阅读全文
posted @ 2024-04-05 20:43 archer2333 阅读(39) 评论(0) 推荐(0)
摘要: https://atcoder.jp/contests/abc201 D - Game in Momotetsu World 由题意可得为一道博弈论题 通过思考可得为博弈DP 其中通过分析可得 所以每次状态转移都得转换视角 当两个人无限聪明时 转换视角后 看到的就是相对于上一个人落后的大小 所以取f 阅读全文
posted @ 2024-04-05 00:21 archer2333 阅读(36) 评论(0) 推荐(0)
摘要: 题目链接https://atcoder.jp/contests/abc200 A - Century 简单的abs(n-1)/100+1即可 B - 200th ABC-200 按题意写代码 点击查看代码 void solve(){ int n,k;cin>>n>>k; for(int i=1;i< 阅读全文
posted @ 2024-04-02 23:36 archer2333 阅读(54) 评论(0) 推荐(0)
摘要: 每天一场ABC QAQ 阅读全文
posted @ 2024-03-31 16:29 archer2333 阅读(13) 评论(0) 推荐(0)
摘要: 7-1 ACM宣传 作者 杜祥军 单位 青岛大学 LB大神想组织集训队去学校各处宣传ACM,但是大神不想让队员们走太多路,因此想写代码计算一下,到各地宣传再回到博知401的最短路径总和是多少。 已知:学校一共有n个宣传点,博知401是标号为1的点。剩下n-1个点每个点各派1位队员,询问每个队员到达宣 阅读全文
posted @ 2024-03-28 22:59 archer2333 阅读(137) 评论(0) 推荐(0)