![](https://img-blog.csdnimg.cn/20201014180756724.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
模拟
键盘里敲打出的巨人
这个时代带给我太多太多,我也要回馈这个时代!!
展开
-
leetcode 564 寻找最近的回文数
Find the Closest Palindrome Given an integer n, find the closest integer (not including itself), which is a palindrome. The ‘closest’ is defined as absolute difference minimized between two integers. ...原创 2020-03-05 08:53:57 · 281 阅读 · 0 评论 -
Find the Closest Palindrome(模拟暴力太久没做题了失败的回顾)
Find the Closest Palindrome Given an integer n, find the closest integer (not including itself), which is a palindrome. The ‘closest’ is defined as absolute difference minimized between two integers. ...原创 2020-02-28 16:32:42 · 198 阅读 · 0 评论 -
cf C. Lock Puzzle 模拟构造
传送门 题意:只有一种操作 shift x 表示 后面x个字符反转在移动到前面来。 问 s字符串能否在6100次操作内变成t。 之前写的每次选择一个字符的步骤为5超过了6100次错了 每次选择一个字符调节位置必须要不超过3次。 ac 代码: #include <cstdio> #include <string> #include <iostream> #incl...原创 2019-11-01 09:57:40 · 173 阅读 · 0 评论 -
2019nyist ccpc final资格选拔赛2 D. Equalize the Remainders 思维贪心模拟
题目链接:http://codeforces.com/problemset/problem/999/D 题意求使数组中所有元素除m的余数相同且等于n/m,的最少操作次数,每次操作可以为一个元素加1. 贪心模拟每个余数超过数量的先变成最近的不满足数量的余数; ac代码: #include<set> #include <cstdio> #include <cst...原创 2019-10-30 09:20:25 · 145 阅读 · 0 评论 -
cf C. Standard Free2play模拟贪心
题目链接:http://codeforces.com/contest/1238/problem/C 题意:在一个高度为h的山上每个高度都有台阶, 其中有n个台阶显示出来,其他都是闭上的,只有显示的能跳,但每跳到一个台阶下一个高度的台阶状态就会变换(注意不是下一个显示的台阶,而是下一个高度x+1)闭上的打开,打开的闭上,如果跳到比原来大于2个距离就会死,每次魔法可以改变某个台阶的状态,问不死跳到底...原创 2019-10-28 10:27:19 · 327 阅读 · 0 评论 -
D - Alice and the Doll 模拟题
在模拟的过程中走着走着死掉了。。。。。 题目链接:https://codeforces.com/contest/1236/problem/D ac代码: #include <cstdio> #include <cstring> #include <vector> #include <iostream> #include <algorit...原创 2019-10-24 09:35:35 · 195 阅读 · 0 评论