
思维
LucienShui
因为孤独是人之常态,所以陪伴才显得格外可贵。
展开
-
UPC-5573 - Rental Service - 枚举
题解链接:https://lucien.ink/archives/118/题目链接:http://exam.upc.edu.cn/problem.php?id=5573题目:题目描述Farmer John realizes that the income he receives from milk production is insufficient to ...原创 2018-03-12 22:24:15 · 304 阅读 · 0 评论 -
Codeforces-976C - Nested Segments - 思维
题解链接:https://lucien.ink/archives/190/题目链接:http://codeforces.com/contest/976/problem/C题目:You are given a sequence a1, a2, …, an of one-dimensional segments numbered 1 through n. Your task...原创 2018-05-01 01:08:30 · 636 阅读 · 0 评论 -
Codeforces-976E - Well played! - 贪心
题解链接:https://lucien.ink/archives/194/题目链接:http://codeforces.com/contest/976/problem/E题目:Recently Max has got himself into popular CCG “BrainStone”. As “BrainStone” is a pretty intellectu...原创 2018-05-01 01:22:12 · 623 阅读 · 0 评论 -
Codeforces-975A - Aramic script - 思维
题解链接:https://lucien.ink/archives/202/题目链接:http://codeforces.com/contest/975/problem/A题目:In Aramic language words can only represent objects.Words in Aramic have special properties:A ...原创 2018-05-03 08:51:03 · 451 阅读 · 0 评论 -
Codeforces-975B - Mancala - 思维
题解链接:https://lucien.ink/archives/203/题目链接:http://codeforces.com/contest/975/problem/B题目:Mancala is a game famous in the Middle East. It is played on a board that consists of 14 holes...原创 2018-05-03 09:09:20 · 447 阅读 · 0 评论 -
Codeforces-975C - Valhalla Siege - 思维
题解链接:https://lucien.ink/archives/204/题目链接:http://codeforces.com/contest/975/problem/C题目:Ivar the Boneless is a great leader. He is trying to capture Kattegat from Lagertha. The war has b...原创 2018-05-03 09:35:36 · 610 阅读 · 0 评论 -
Codeforces-975D - Ghosts - 思维
题解链接https://lucien.ink/archives/205/题目链接http://codeforces.com/contest/975/problem/D题目Ghosts live in harmony and peace, they travel the space without any purpose other than scare whoe...原创 2018-05-03 11:29:39 · 300 阅读 · 2 评论 -
ARC-061D - Snuke's Coloring - 思维
题解链接https://lucien.ink/archives/231/题目链接https://arc061.contest.atcoder.jp/tasks/arc061_b题目Problem StatementWe have a grid with HHH rows and WWW columns. At first, all cells were pain...原创 2018-05-20 23:52:46 · 550 阅读 · 0 评论 -
Codeforces-985A - Chess Placing - 思维
题解链接https://lucien.ink/archives/232/题目链接http://codeforces.com/contest/985/problem/A题目You are given a chessboard of size 1×n1 × n1 × n. It is guaranteed that n is even. The chessboard...原创 2018-05-22 08:08:44 · 538 阅读 · 0 评论 -
Codeforces-985B - Switches and Lamps - 思维
题解链接https://lucien.ink/archives/233/题目链接http://codeforces.com/contest/985/problem/B题目You are given n switches and m lamps. The i-th switch turns on some subset of the lamps. This informa...原创 2018-05-22 08:21:04 · 1111 阅读 · 3 评论 -
Codeforces-976B - Lara Croft and the New Game - 思维
题解链接:https://lucien.ink/archives/189/题目链接:http://codeforces.com/contest/976/problem/B题目:You might have heard about the next game in Lara Croft series coming out this year. You also m...原创 2018-05-01 00:59:12 · 379 阅读 · 3 评论 -
Codeforces-976A - Minimum Binary Number - 思维
题解链接:https://lucien.ink/archives/188/题目链接:http://codeforces.com/contest/976/problem/A题目:String can be called correct if it consists of characters “0” and “1” and there are no redundant l...原创 2018-05-01 00:51:10 · 325 阅读 · 0 评论 -
UPC-5155 - Security Badges - 思维
题解链接:https://lucien.ink/archives/187/题目链接:http://exam.upc.edu.cn/problem.php?id=5155题目:题目描述You are in charge of the security for a large building. The building has a map, consist...原创 2018-04-30 21:58:28 · 275 阅读 · 0 评论 -
UPC-5841 - 最大团 - 思维
题解链接:https://lucien.ink/archives/120/题目链接:http://exam.upc.edu.cn/problem.php?id=5841题目:题目描述数轴上有n个点,第i个点的坐标为xi,权值为wi。两个点i,j之间存在一条边当且仅当abs(xi-xj)>=wi+wj。 你需要求出这张图的最大团的点数。 (团就是两两之间...原创 2018-03-12 22:49:15 · 223 阅读 · 0 评论 -
BZOJ-3505 - 数三角形 - 思维
题解链接:https://lucien.ink/archives/126/题目链接:http://www.lydsy.com/JudgeOnline/problem.php?id=3505题目:Description给定一个nxm的网格,请计算三点都在格点上的三角形共有多少个。下图为4x4的网格上的一个三角形。注意三角形的三点不能共线。Input...原创 2018-03-20 16:10:28 · 383 阅读 · 0 评论 -
UPC-4979 - Amsterdam Distance - 思维
题解链接:https://lucien.ink/archives/152/题目链接:http://exam.upc.edu.cn/problem.php?id=4979题目:题目描述Your friend from Manhattan is visiting you in Amsterdam. Because she can only stay for a sh...原创 2018-04-15 11:31:57 · 205 阅读 · 0 评论 -
UPC-5579 - BBQ Hard - 思维 & 组合数学 & 动态规划
题解链接:https://lucien.ink/archives/132/题目链接:http://exam.upc.edu.cn/problem.php?id=5579题目:题目描述Snuke is having another barbeque party.This time, he will make one serving of Skewer Meal...原创 2018-04-04 16:09:31 · 232 阅读 · 0 评论 -
UPC-5556 - Black and White - 扫描线 & 线段树
题解链接:https://lucien.ink/archives/134/题目链接:http://exam.upc.edu.cn/problem.php?id=5556题目:题目描述Consider a square map with N × N cells. We indicate the coordinate of a cell by (i, j), w...原创 2018-04-05 19:29:21 · 183 阅读 · 0 评论 -
UPC-5095 - Hopscotch - 思维
题解链接:https://lucien.ink/archives/160/题目链接:http://exam.upc.edu.cn/problem.php?id=5095题目:题目描述You’re playing hopscotch! You start at the origin and your goal is to hop to the lattice po...原创 2018-04-21 23:18:13 · 227 阅读 · 0 评论 -
UPC-5093 - Orderly Class - 思维
题解链接:https://lucien.ink/archives/165/题目链接:http://exam.upc.edu.cn/problem.php?id=5093题目:题目描述Ms. Thomas is managing her class of n students. She placed all her students in a line, and...原创 2018-04-21 23:57:02 · 173 阅读 · 0 评论 -
UPC-4991 - Manhattan Mornings - 最长不下降子序列
题解链接:https://lucien.ink/archives/156/题目链接:http://exam.upc.edu.cn/problem.php?id=4991题目:题目描述As a New Yorker you are always very busy. Apart from your long work day you tend to hav...原创 2018-04-18 22:04:33 · 247 阅读 · 0 评论 -
UPC-5206 - The Game of Life - 模拟
题解链接:https://lucien.ink/archives/148/题目链接:http://exam.upc.edu.cn/problem.php?id=5206题目:题目描述From an evolutionary gene’s-eye perspective, the genes are immortal, and our role, the me...原创 2018-04-13 19:02:44 · 333 阅读 · 0 评论 -
Codeforces-984A - Game - 思维
题解链接:https://lucien.ink/archives/209/题目链接:http://codeforces.com/contest/984/problem/A题目:Two players play a game.Initially there are n integers a1,a2,…,ana1,a2,…,ana_1,a_2,…,a_n written...原创 2018-05-16 01:02:12 · 393 阅读 · 0 评论 -
Codeforces-984C - Finite or not? - 思维
题解链接:https://lucien.ink/archives/211/题目链接:http://codeforces.com/contest/984/problem/C题目:You are given several queries. Each query consists of three integers ppp, qqq and bbb. You need to...原创 2018-05-16 01:38:31 · 487 阅读 · 2 评论 -
Codeforces-984D - XOR-pyramid - 思维
题解链接:https://lucien.ink/archives/212/题目链接:http://codeforces.com/contest/984/problem/D题目:For an array bbb of length mmm we define the function fff asf(b){b[1],f(b[1]⊕b[2],b[2]⊕b[3],…,b[...原创 2018-05-16 02:11:30 · 710 阅读 · 0 评论 -
Codeforces - 1139B - Chocolates
地址https://codeforces.com/contest/1139/problem/B原文地址https://www.lucien.ink/archives/407题意你有 nnn 堆物品,第 iii 堆物品有 aia_iai 个,如果你要从第 iii 堆物品中取走 xix_ixi 个,那么对于 1≤j<i1 \leq j < i1≤j<i ...原创 2019-03-25 01:28:34 · 185 阅读 · 0 评论 -
Codeforces - 1139C - Edgy Trees
地址https://codeforces.com/contest/1139/problem/C原文地址https://www.lucien.ink/archives/408题解容斥一下。代码https://pasteme.cn/4939#include <bits/stdc++.h>typedef long long ll;const int maxn = int(...原创 2019-03-25 01:29:47 · 217 阅读 · 0 评论 -
Codeforces - 1139D - Steps to One
地址https://codeforces.com/contest/1139/problem/D原文地址https://www.lucien.ink/archives/409题意模拟一个循环,一开始有一个空序列,之后每次循环:从 [1,m][1, m][1,m] 中等概率选出一个数字添加到序列里去。检查这个序列所有元素的 gcdgcdgcd 是否为 111,如果为 111 则停...原创 2019-03-25 01:31:05 · 629 阅读 · 0 评论 -
Codeforces - 1153A - Serval and Bus
地址https://codeforces.com/contest/1153/problem/A原文地址https://www.lucien.ink/archives/413代码https://pasteme.cn/6247#include <bits/stdc++.h>int main() { int n, m, min = 0x3f3f3f3f, ans, bu...原创 2019-04-15 00:02:14 · 732 阅读 · 0 评论 -
Codeforces - 1155A - Reverse a Substring
地址https://codeforces.com/contest/1155/problem/A原文地址https://www.lucien.ink/archives/417/题意给你一个串 sss ,问能否翻转一个区间使得它的字典序变小。题解先 sort 一下判断是否可以,可以的话枚举一下。代码https://pasteme.cn/6687#include <bits/s...原创 2019-04-23 15:30:21 · 258 阅读 · 0 评论 -
Codeforces - 1155B - Game with Telephone Numbers
地址https://codeforces.com/contest/1155/problem/B原文地址https://www.lucien.ink/archives/418/题意如果一个纯数字的串长度为 111111 且以数字 888 开头,那么这个串就是一个好串,给你一个纯数字的串 sss ,你和另一个人轮流从中任意删掉一个数字,你先手,直到这个串的长度变为 111111 ,如果最后的...原创 2019-04-23 15:38:38 · 258 阅读 · 0 评论 -
Codeforces - 1155C - Alarm Clocks Everywhere
地址https://codeforces.com/contest/1155/problem/C原文地址https://www.lucien.ink/archives/419/题意你有 nnn 个事件,第 iii 个事件需要在第 xix_ixi 时刻去做,你是一个机器人,你只能选定任意一个起始时间 yyy ,然后从给定的 mmm 个数字中选出一个 pip_ipi ,然后你从第 yyy ...原创 2019-04-23 15:47:45 · 233 阅读 · 0 评论 -
Codeforces - 1152B - Neko Performs Cat Furrier Transform
地址https://codeforces.com/contest/1152/problem/B原文地址https://www.lucien.ink/archives/422/题意给你一个 xxx ,让你在 404040 步之内把它变成 2n−12 ^ n - 12n−1 的形式,你一定会在奇数步将其异或上一个值 2k−12 ^ k - 12k−1 ,在偶数步将其自增 111 ,让你输出你...原创 2019-04-25 00:49:30 · 513 阅读 · 0 评论 -
Codeforces - 1152C - Neko does Maths
地址https://codeforces.com/contest/1152/problem/C原文地址https://www.lucien.ink/archives/423/题意给你 aaa 和 bbb ,找到一个最小的 kkk ,使得 lcm(a+k,b+k)lcm(a + k, b + k)lcm(a+k,b+k) 最小。题解不妨设 a>ba > ba...原创 2019-04-25 00:58:47 · 434 阅读 · 0 评论 -
Codeforces - 1139A - Even Substrings
地址https://codeforces.com/contest/1139/problem/A原文地址https://www.lucien.ink/archives/406题意给你一个只包含数字的字符串,问有多少个子串是偶数。代码https://pasteme.cn/4937#include <bits/stdc++.h>typedef long long ll;c...原创 2019-03-25 01:27:57 · 136 阅读 · 0 评论 -
Codeforces - 1098C - Construct a tree
地址https://codeforces.com/contest/1098/problem/C原文地址https://www.lucien.ink/archives/402/题意能否构造出一棵 nnn 个节点的树,使得以每个点为根的子树的 sizesizesize 加起来等于 sss ,如果能,输出使得儿子最多的点的儿子数目最少的那种。题解不难看出,以每个点为根的子树的 sizesi...原创 2019-03-11 22:52:01 · 170 阅读 · 0 评论 -
Codeforces - 1098B - Nice table
地址https://codeforces.com/contest/1098/problem/A原文地址https://www.lucien.ink/archives/401/题意给你一个表格,上面只有四种字符 ATCGATCGATCG 。你可以把任意位置上的字符替换成这四种中的一种,问所有满足在替换之后对于每个 2⋅22 \cdot 22⋅2 的正方形四种字符全部都出现的表格中,且和原...原创 2019-03-11 22:44:31 · 270 阅读 · 0 评论 -
Codeforces-989B - A Tide of Riverscape - 思维
题解链接http://www.lucien.ink/archives/269/题目链接http://codeforces.com/contest/989/problem/B题目The records are expressed as a string s of characters ‘0’, ‘1’ and ‘.’, where ‘0’ denotes a low ti...原创 2018-06-13 19:57:11 · 324 阅读 · 0 评论 -
Codeforces-989C - A Mist of Florescence - 思维
题解链接https://www.lucien.ink/archives/270/题目链接http://codeforces.com/contest/989/problem/C题目There are four kinds of flowers in the wood, Amaranths, Begonias, Centaureas and Dianthuses....原创 2018-06-13 20:16:15 · 209 阅读 · 0 评论 -
HDU-6396 - Swordsman - 思维
题解链接https://www.lucien.ink/archives/316/题目链接http://acm.hdu.edu.cn/showproblem.php?pid=6396题目Lawson is a magic swordsman with k kinds of magic attributes v1,v2,v3,…,vk. Now Lawson is face...原创 2018-08-15 23:55:25 · 286 阅读 · 0 评论