\(\color{#0066ff}{ 题目描述 }\) 逃不掉的那一天还是来了,小 F 看着夜空发呆. 天上空荡荡的,没有一颗星星--大概是因为天上吹不散的乌云吧. 心里吹不散的乌云,就让它在那里吧,反正也没有机会去改变什么了. 小 C 拿来了一长串星型小灯泡,假装是星星,递给小 F,想让小 F 开心一点.不过,有 着强迫症的小 F 发现,这串一共 n 个灯泡的灯泡串上有 k 个灯泡没有被点亮.小 F 决定 和小 C 一起把这个灯泡串全部点亮. 不过,也许是因为过于笨拙,小 F 只能将其中连续一…
洛谷P3943 星空 题目背景 命运偷走如果只留下结果, 时间偷走初衷只留下了苦衷. 你来过,然后你走后,只留下星空. 题目描述 逃不掉的那一天还是来了,小 F 看着夜空发呆. 天上空荡荡的,没有一颗星星——大概是因为天上吹不散的乌云吧. 心里吹不散的乌云,就让它在那里吧,反正也没有机会去改变什么了. 小 C 拿来了一长串星型小灯泡,假装是星星,递给小 F,想让小 F 开心一点. 不过,有 着强迫症的小 F 发现,这串一共 n 个灯泡的灯泡串上有 k 个灯泡没有被点亮. 小 F 决定 和小 C…
好思路,好思路... 思路:前缀异或差分 提交:1次 题解:区间修改,单点查询,树状数组,如思路$qwq$ #include<cstdio> #include<iostream> using namespace std; #define R register int #define ull unsigned long long #define ll long long #define pause (for(R i=1;i<=10000000000;++i)) #define…
E. XOR and Favorite Number time limit per test 4 seconds memory limit per test 256 megabytes input standard input output standard output Bob has a favorite number k and ai of length n. Now he asks you to answer m queries. Each query is given by a pai…
Tree Ming and Hong are playing a simple game called nim game. They have nn piles of stones numbered 11 to nn ,the ii-th pile of stones has a_iai stones. There are n - 1n−1 bidirectional roads in total. For any two piles, there is a unique path from…
题目背景 命运偷走如果只留下结果, 时间偷走初衷只留下了苦衷. 你来过,然后你走后,只留下星空. 题目描述 逃不掉的那一天还是来了,小 F 看着夜空发呆. 天上空荡荡的,没有一颗星星——大概是因为天上吹不散的乌云吧. 心里吹不散的乌云,就让它在那里吧,反正也没有机会去改变什么了. 小 C 拿来了一长串星型小灯泡,假装是星星,递给小 F,想让小 F 开心一点.不过,有 着强迫症的小 F 发现,这串一共 n 个灯泡的灯泡串上有 k 个灯泡没有被点亮.小 F 决定 和小 C 一起把这个灯泡串全部点亮.…
D. Mishka and Interesting sum time limit per test 3.5 seconds memory limit per test 256 megabytes input standard input output standard output Little Mishka enjoys programming. Since her birthday has just passed, her friends decided to present her wit…
Problem 11: Switching Lights [LongFan, 2008] Farmer John tries to keep the cows sharp by letting them play with intellectual toys. One of the larger toys is the lights in the barn. Each of the N (2 <= N <= 500) cow stalls conveniently numbered 1..N…
其实我做的是洛谷的P3943,但是听说fstqwq窃题...... 题目描述: 小 C 拿来了一长串星型小灯泡,假装是星星,递给小 F,想让小 F 开心一点.不过,有 着强迫症的小 F 发现,这串一共 n 个灯泡的灯泡串上有 k 个灯泡没有被点亮.小 F 决定 和小 C 一起把这个灯泡串全部点亮. 不过,也许是因为过于笨拙,小 F 只能将其中连续一段的灯泡状态给翻转--点亮暗灯 泡,熄灭亮灯泡.经过摸索,小 F 发现他一共能够翻转 m 种长度的灯泡段中灯泡的状态. 小 C 和小 F 最终花了很长…