随笔分类 -  codeforces

摘要:## 题目描述 You have a set $ S $ of $ n $ distinct integers between $ 1 $ and $ m $ . Each second you do the following steps: 1. Pick an element $ x $ in 阅读全文
posted @ 2023-09-04 15:12 灰鲭鲨 阅读(45) 评论(0) 推荐(0) 编辑
摘要:## 题目描述 You are given $ n $ intervals and $ m $ points on the number line. The $ i $ -th intervals covers coordinates $ [l_i,r_i] $ and the $ i $ -th 阅读全文
posted @ 2023-08-25 17:51 灰鲭鲨 阅读(15) 评论(0) 推荐(0) 编辑
摘要:Let $ c $ be some positive integer. Let's call an array $ a_1, a_2, \ldots, a_n $ of positive integers $ c $ -array, if for all $ i $ condition $ 1 \l 阅读全文
posted @ 2023-08-25 17:47 灰鲭鲨 阅读(9) 评论(0) 推荐(0) 编辑
摘要:## 题目描述 LuoTianyi gives you an array $ a $ of $ n $ integers and the index begins from $ 1 $ . Define $ g(i,j) $ as follows: - $ g(i,j) $ is the large 阅读全文
posted @ 2023-08-24 22:46 灰鲭鲨 阅读(31) 评论(0) 推荐(0) 编辑
摘要:## 题目描述 John Doe offered his sister Jane Doe find the gcd of some set of numbers $ a $ . Gcd is a positive integer $ g $ , such that all number from t 阅读全文
posted @ 2023-08-06 23:17 灰鲭鲨 阅读(12) 评论(0) 推荐(0) 编辑
摘要:# XOR Partition ## 题目描述 For a set of integers $ S $ , let's define its cost as the minimum value of $ x \oplus y $ among all pairs of different intege 阅读全文
posted @ 2023-07-29 19:41 灰鲭鲨 阅读(47) 评论(0) 推荐(0) 编辑
摘要:# Optimal Insertion ## 题面翻译 ### 题目大意 给定两个序列 $a,b$,长度分别为 $n,m(1\leq n,m\leq 10^6)$。接下来将 $b$ 中的所有元素以**任意方式**插入序列 $a$ 中**任意位置**,请找出一种插入方式使结果序列中的逆序对数量最小化, 阅读全文
posted @ 2023-07-26 11:51 灰鲭鲨 阅读(6) 评论(0) 推荐(0) 编辑
摘要:## 题目描述 You are given a tree with $ n $ nodes labelled $ 1,2,\dots,n $ . The $ i $ -th edge connects nodes $ u_i $ and $ v_i $ and has an unknown posi 阅读全文
posted @ 2023-07-26 09:09 灰鲭鲨 阅读(28) 评论(0) 推荐(0) 编辑
摘要:# X-OR ## 题面翻译 ### 题目描述 本题是**交互题**。 有一个固定的长度为 $n$ 的排列 $P$,其值域为 $[0,n-1]$,你可以进行不超过 $4269$ 次询问,之后你需要输出这个排列 $P$。 ### 输入格式 第一行有一个正整数 $n$,表示排列的长度。 保证 $3\le 阅读全文
posted @ 2023-07-22 13:46 灰鲭鲨 阅读(13) 评论(0) 推荐(0) 编辑
摘要:题目描述 You are given a tree of $ n $ vertices. The vertices are numbered from $ 1 $ to $ n $ . You will need to assign a weight to each edge. Let the we 阅读全文
posted @ 2023-03-15 16:28 灰鲭鲨 阅读(57) 评论(0) 推荐(0) 编辑
摘要:题目描述 "Duel!" Betting on the lovely princess Claris, the duel between Tokitsukaze and Quailty has started. There are $ n $ cards in a row. Each card ha 阅读全文
posted @ 2023-02-09 20:52 灰鲭鲨 阅读(15) 评论(0) 推荐(0) 编辑
摘要:T-Shirts 题目描述 The big consignment of t-shirts goes on sale in the shop before the beginning of the spring. In all $ n $ types of t-shirts go on sale. 阅读全文
posted @ 2023-02-09 20:36 灰鲭鲨 阅读(45) 评论(0) 推荐(0) 编辑
摘要:题目描述 There are $ n $ points on the plane, the $ i $ -th of which is at $ (x_i, y_i) $ . Tokitsukaze wants to draw a strange rectangular area and pick 阅读全文
posted @ 2023-02-07 20:42 灰鲭鲨 阅读(24) 评论(0) 推荐(0) 编辑
摘要:题目描述 You have an array $ a_0, a_1, \ldots, a_{n-1} $ of length $ n $ . Initially, $ a_i = 2^i $ for all $ 0 \le i \lt n $ . Note that array $ a $ is z 阅读全文
posted @ 2023-01-23 10:25 灰鲭鲨 阅读(26) 评论(0) 推荐(0) 编辑
摘要:题目描述 The position of the leftmost maximum on the segment $ [l; r] $ of array $ x = [x_1, x_2, \ldots, x_n] $ is the smallest integer $ i $ such that $ 阅读全文
posted @ 2022-12-22 20:11 灰鲭鲨 阅读(22) 评论(0) 推荐(0) 编辑
摘要:题目描述 You are given three integers $ a $ , $ b $ , and $ d $ . Your task is to find any integer $ x $ which satisfies all of the following conditions, 阅读全文
posted @ 2022-12-22 18:08 灰鲭鲨 阅读(16) 评论(0) 推荐(0) 编辑
摘要:Ehab's REAL Number Theory Problem 题目描述 You are given an array $ a $ of length $ n $ that has a special condition: every element in this array has at m 阅读全文
posted @ 2022-12-21 19:16 灰鲭鲨 阅读(19) 评论(0) 推荐(0) 编辑
摘要:题目描述 There are $ n $ cities in the Kingdom of Autumn, numbered from $ 1 $ to $ n $ . People can travel between any two cities using $ n-1 $ two-direct 阅读全文
posted @ 2022-11-21 20:58 灰鲭鲨 阅读(1) 评论(0) 推荐(0) 编辑
摘要:【题目描述】 显然,我们每个人都熟悉Tic-tac-toe游戏。 这个游戏的规则是:两个人依次在3X3的棋盘上下棋。 当一个人有3个棋子连成一行或一列或一纵列时,则这个人已经获得胜利。这时则停止下棋。第一个人先下,第二个人后下。 现在,请你判断一游戏的状态。 first,现在轮到第一个人下。 sec 阅读全文
posted @ 2022-04-08 21:40 灰鲭鲨 阅读(411) 评论(0) 推荐(0) 编辑