
codeforce
文章平均质量分 50
WarBlood
怨尤不会让困难消失,
但乐观会让人更加强大。
展开
-
CodeForce Palindrome Game (hard version)
题目链接:https://codeforces.com/contest/1527/problem/B2 题意: 选择任意i(1≤i≤n),其中s[i]=‘0’,并将s[i]改为‘1’。付1美元。 反转整个字符串,支付0美元。只有当字符串当前不是回文,并且上一次操作不是反向操作时,才允许此操作。也就是说,如果Alice颠倒了弦,那么Bob在下一步就不能颠倒了,反之亦然。 颠倒字符串意味着将其字母从最后一个重新排序到第一个。例如,颠倒后“01001”变成“10010”。 当字符串的每个字符都变成‘1’时,游戏结原创 2021-05-21 13:06:40 · 161 阅读 · 1 评论 -
18th 浙江省省赛 F. Fair Distribution
题目链接:https://codeforces.com/gym/103055/problem/F 题面: 给你一个n表示有多少机器人,m表示有多少能量棒。机器人每次只能减少,能量棒每次只能增加,消耗1金。问最少消耗多少钱让 m%n==0; 思路: (m-1) / i * i 用整数分块求最小值 AC代码: /** * @Author: WarBlood 584299804@qq.com * @Create: 2021/5/20 20:26 */ #include <bits/stdc++.h原创 2021-05-20 20:27:15 · 810 阅读 · 3 评论 -
codeofrces Do you want a date?
C. Do you want a date? time limit per test:2 seconds memory limit per test:256 megabytes input:standard input output:standard output Leha decided to move to a quiet town Vičkopolis, because he was tired by living in Bankopolis. Upon arrival he immediately原创 2021-02-27 15:11:04 · 275 阅读 · 0 评论