2024.7.4 鲜花

今日推歌 natural

Will you hold the line.

只有你还没有放弃。

When every one of them is giving up or giving in, tell me.

当其他所有人都停止了尝试,被挫折磨尽了希望。

In this house of mine,Nothing ever comes without a consequence or cost, tell me.

我所在之处,凡事皆有因果报应,没有什么得来轻而易举所以告诉我。

Will the stars align?

星星是否会排列成线?

Will heaven step in? Will it save us from our sin? Will it?

上帝之手是否会介入,更改冥冥中的定数,将我们从犯下的罪恶中解救。

'Cause this house of mine stands strong.

而我无所顾忌,因为我建立的国度会永恒伫立。

That's the price you pay.

这就是你要付出的代价。

Leave behind your heartache, cast away.

不要沉溺于眼下的心碎,抛之脑后告诉自己。

Just another product of today.

这不过是今天遇到的又一小事而已

Rather be the hunter than the prey.

别再学猎物般逃窜,要像猎人一样主动出击。

And you're standing on the edge,Face up 'cause you're a.

现在你站在悬崖的边缘,抬起头面对因为你。

Natural.

生来如此。

A beating heart of stone,You gotta be so cold.

就像坚石般强有力的心跳,你要学着变得冷酷坚硬。

To make it in this world,Yeah, you're a natural.

在这个世界寻到自己的立足之地,这就是你的天性使然。

Living your life cutthroat,You gotta be so cold.

在残酷的竞争中生存,你要学着变得冷酷坚硬

Yeah, you're a natural.

是的,这就是你的天性。

Will somebody Let me see the light within the dark trees' shadows and.

是否有人能够,让我看见穿过窸窣树影透下的斑驳的光。

What's happenin'?Lookin' through the glass find the wrong.

发生了什么,透过放大镜的镜片仔细找寻着。

Within the past knowin.

过去的错误的足迹。

Oh, we are the youth,Call out to the beast,

我们年轻气盛意气风发,肆意释放内心隐藏的兽性。

Not a word without the peace, facing,A bit of the truth, the truth.

而嘴里的话语却不忘和平,而这只是你尚需了解的冰山一角。

That's the price you pay.

这就是你要付出的代价。

Leave behind your heartache, cast away.

不要沉溺于眼下的心碎,抛之脑后告诉自己。

Just another product of today.

这不过是今天遇到的又一小事而已。

Rather be the hunter than the prey.

别再学猎物般逃窜,要像猎人一样主动出击。

And you're standing on the edge,Face up 'cause you're a.

现在你站在悬崖的边缘,抬起头面对因为你。

Natural

生来如此。

A beating heart of stone,You gotta be so cold.

就像坚石般强有力的心跳,你要学着变得冷酷坚硬。

To make it in this world,Yeah, you're a natural.

在这个世界寻到自己的立足之地,这就是你的天性使然。

Living your life cutthroat,You gotta be so cold.

在残酷的竞争中生存,你要学着变得冷酷坚硬

Yeah, you're a natural

是的,这就是你的天性。

Living your life cutthroat,You gotta be so cold.

在残酷的竞争中生存,你要学着变得冷酷坚硬

Yeah, you're a natural

是的,这就是你的天性。

Deep inside me, I'm fading to black, I'm fading

我的内心深处,正在一点一点被黑色侵蚀吞没。

Took an oath by the blood of my hand, won't break it

即使用我手上的血所立的誓约,也无法改变这一切。

I can taste it, the end is upon us, I swear

我能够感觉到,结局的走向由我们掌舵,我发誓我一定会做到。

Gonna make it,I'm gonna make it.

不顾一切地成功,我会不顾一切地成功。

Natural

生来如此。

A beating heart of stone,You gotta be so cold.

就像坚石般强有力的心跳,你要学着变得冷酷坚硬。

To make it in this world,Yeah, you're a natural.

在这个世界寻到自己的立足之地,这就是你的天性使然。

Living your life cutthroat,You gotta be so cold.

在残酷的竞争中生存,你要学着变得冷酷坚硬

Yeah, you're a natural

是的,这就是你的天性。

Living your life cutthroat,You gotta be so cold.

在残酷的竞争中生存,你要学着变得冷酷坚硬

Yeah, you're a natural

是的,这就是你的天性。

Natural

生来如此,

Yeah, you're a natural

是的,这就是你的天性。

reverse 加强

定义 \(R(x)\) 表示将整数 \(x\) 左右翻转的后的数 \(1223\to3221\),其中 \(x\) 没有前导 \(0\)

\(t\) 组测试,每组求满足 \(l \le x \le r \And l \le R(x) \le r\)\(x\) 个数。

\(l,r\le 10^{18},t=10^6\)

原题太水了,不能体现出算法的优越。

solve:

首先去掉下界,考虑容斥,则原式:

\[=(x \le r \And R(x) \le r) - (x < l \And R(x) \le r) - (x \le r \And R(x) < l) + (x < l \And R(x) < l) \]

所以问题变为解决 \(x \le A \And R(x) \le B\)

发现将 \(x\) 翻转过于抽象,因为整数比较大小等价于补充前导 \(0\) 后比较字典序,所以我们将 \(B\) 旋转,比较就从后向前字典序比较。

分讨:

\(len(A)\) 表示 \(A\) 的长度。

  1. \(len(A)\ge len(B)\)

    考虑前导 \(0\)

    单算首位填 \(0\)

    因为 \(len(A)\) 较长,所以 \(A\) 首位 \(\ge 1\),所以当首位填 \(0\) 时,一定满足了 \(x \le A\)

    算出最多有 \(len(A)-1\) 位且 \(R(x) \le B\) 的个数即可。

    直接填翻转后的,发现一个合法的数翻转后一定没有后缀 \(0\),且有不同个数前导 \(0\) 是不同情况,考虑恰好 \(k\) 位没有前导 \(0\) 的数翻转后有两种限制:位数(如三位时:\(100 \le R(x) \le 999\))和 \(R(x) \le B\),算出其中不含后缀 \(0\) 的个数(不整除 \(10\)),在乘可以加前导 \(0\) 的个数即可。

    在算第一位不填 \(0\),直接从前向后填,每次不卡上界时,未填的数对应的 \(B\) 前缀(翻转前)的值就是方案数,判断已经填了的数和其对应 \(B\) 后缀(翻转前)的大小来判断是否可以取等,卡上界时直接换下一位。

    发现这样最后会算成 \(x < A\),提前将 \(A\) 加一即可。

  2. \(len(A)\ge len(B)\)

    发现翻转不会使位数增加,所以在 \(x \le A\) 时一定有 \(R(x) \le B\),答案为 \(A+1\)

糖(from lty)
——————————————————————
|                  敬  |
|                  赠  |
|           素     :  |
|    陆     质     xr  |
|    佰     高     素  |
|    陆     尚     质  |
|    拾     ,     哥  |
|    叁     救         |
|    又     死         |
|    贰     扶         |
|    分     伤         |
|    之     。         |
|    壹                |
| 二 减                |
| 〇 贰                |
| 二 分                |
| 四 之                |
| 年 壹                |
| 七 分                |
| 月 哥                |
| 四                   |
| 日                   |
..                    ..
|...                 ..|
 ||....          ....||
   |||..... ......|||
      |||||.||||||
           |
评论:From *4000 General K8He

posted @ 2024-07-04 20:24  xrlong  阅读(28)  评论(2编辑  收藏  举报