【POJ 3468】A Simple Problem with Integers【分块】 题目大意: 题目链接:http://poj.org/problem?id=3468 给出一个初始数列,有两种操作: Q x yQ\ x\ yQxy,输出这个数列xxx到yyy之间的数字和。 C x y zC\ x\ y\ zCxyz,将这个数列的xxx到yyy之间的数加上zzz。 思路: 线段树方法 树状数组方法 这...
【POJ 3468】A Simple Problem with Integers【分块】 题目大意: 题目链接:http://poj.org/problem?id=3468 给出一个初始数列,有两种操作: QxyQxy,输出这个数列xx到yy之间的数字和。 CxyzCxyz,将这个数列的xx到yy之间的数加上zz。 思路: 线段树方法 树状数组方法 这道题还可以用分块做。。。 模板的分块...
洛谷评测传送门 题目描述 Kolya is very absent-minded. Today his math teacher asked him to solve a simple problem with the equation a + 1 = ba+1=bwith positive integers aaand bb, but Kolya forgot the numbers aaand bb. He does, however, remember that the first (leftmost) digit of aawa...
第一行一个数t (1 <= t <= 10^5); 之后t 行每行两个数n, k(1 <= n, k <= 10^7); 【输出格式】 如果有解,输出"YES",否则输出"NO"; 【解题思路】 从1、3、5开始的 k - 1的个奇数求和得 sum,用n - sum得大于(2 * k - 3)的奇数(因为所用奇数不能重复)则输出“YES” , 否则输...
CF1327A Sum of Odd Integers 数论简单题 2020年3月25日: luogu P1378 油滴扩展 搜索 CF1110A Parity 模拟 CF1110B Tape 思维 2020年3月26日: luogu P6191 [USACO09FEB]Bulls And Cows S 排列组合 CF467A George and Accommodation 刷水题找信心 ...
Say Jimmy had to calculate a function Answer(x, y) where x and y are both integers in the range [1, N]. When he knows Answer(x, y), he can easily derive Answer(k*x, k*y), where k is any integer from it by applying some simple calculations involving Answer(x, y) and k. ...
(red, green, blue, yellow…), so you may assume that the total number of different colors T is very small. To make it simple, we express the names of colors as color 1, color 2, ... color T. At the beginning, the board was painted in color 1. Now the rest of problem is ...