随笔分类 - 思维题
摘要:"E A Simple Problem" "HDU 4143 " 题目描述 For a given positive integer n, please find the smallest positive integer x that we can find an integer y such t
阅读全文
摘要:分析 这道题$n\leq10^{6}$,显然$n^{2}$的暴力是无法解决问题的 那么我们可以考虑数列的某一种性质 因为最终的答案是$\sum{n \atop i=1} |p_i i|$,和绝对值有关,所以我们把数列中的数分为两类 第一类是$p_i i 0$,第二类是$p_i i\leq0$ 我们可
阅读全文
摘要:题目描述 B君和G君聊天的时候想到了如下的问题。 给定自然数l和r ,选取2个整数x,y满足l using namespace std; typedef long long ll; int main(){ ll aa,bb,t; scanf("%lld",&t); while(t ){ scanf(
阅读全文
摘要:题目描述 Although Inzane successfully found his beloved bone, Zane, his owner, has yet to return. To search for Zane, he would need a lot of money, of whi
阅读全文
摘要:题目描述 你有 1020 个格子,它们从 0 开始编号,初始时所有格子都还未染色,现在你按如下规则对它们染色: 1. 编号是 p1 倍数的格子(包括 0号格子,下同)染成红色。 2. 编号是 p2 倍数的格子染成蓝色。 3. 编号既是 p1 倍数又是 p2 倍数的格子,你可以选择染成红色或者蓝色。
阅读全文
摘要:题目描述 The only difference between the easy and the hard versions is the maximum value of k. You are given an infinite sequence of form "112123123412345
阅读全文
摘要:题目描述 Slastyona and her loyal dog Pushok are playing a meaningless game that is indeed very interesting. The game consists of multiple rounds. Its rule
阅读全文
摘要:题目一:Ants 传送门 题目描述 输入 输出 样例 样例输入 2 10 3 2 6 7 214 7 11 12 7 13 176 23 191 View Code 样例输出 4 8 38 207 View Code 分析 一句话题意:有n只蚂蚁在木棍上爬行,每只蚂蚁的速度都是每秒1单位长度,现在给
阅读全文
摘要:题目描述 输入 输出 样例 样例输入 5 2 7 1 1 1 2 1 3 2 3 2 4 4 4 5 2 样例输入一 500 500 16 1 1 1 2 1 999 1 1000 2 1 2 2 2 999 2 1000 3 1 3 2 3 999 3 1000 499 500 499 501 4
阅读全文
摘要:写在前面:这道题并不是简单的思维题,而是一道数学题,所以大家一定要认真推理,不要直接抄代码,理解最重要 题目描述 输入格式 输出格式 输入输出样例 输入样例 3 100 100 100 4 1 2 5 4 View Code 输出样例 0 4 View Code 一句话题意:有n个人围成一圈,每个人
阅读全文
摘要:题目传送门 题目描述 Farmer John has arranged his N (1 ≤ N ≤ 5,000) cows in a row and many of them are facing forward, like good cows. Some of them are facing b
阅读全文
摘要:题目传送门 题目描述 输入 输出 样例 样例输入 5 5 2 3 1 4 2 4 2 3 1 4 View Code 样例输出 Yes No No No Yes View Code 一句话题意:2*n的迷宫,从(1,1)出发到(2,n),初始时全部的都是地面,每次询问会把一个地面给变成熔浆,熔浆变成
阅读全文

浙公网安备 33010602011771号