随笔分类 -  算法基础—排序

摘要:Problem Description TI10 and ICPC World Finals 2020, which will be held earlier? Take a bet! The International(TI) is the biggest and most prestigious 阅读全文
posted @ 2021-08-18 01:53 脂环 阅读(139) 评论(0) 推荐(1) 编辑
摘要:AquaMoon has 𝑛n friends. They stand in a row from left to right, and the 𝑖i-th friend from the left wears a T-shirt with a number 𝑎𝑖ai written on 阅读全文
posted @ 2021-07-13 12:00 脂环 阅读(168) 评论(0) 推荐(0) 编辑
摘要:1711. 大餐计数 难度中等83收藏分享切换为英文接收动态反馈 大餐 是指 恰好包含两道不同餐品 的一餐,其美味程度之和等于 2 的幂。 你可以搭配 任意 两道餐品做一顿大餐。 给你一个整数数组 deliciousness ,其中 deliciousness[i] 是第 i 道餐品的美味程度,返回 阅读全文
posted @ 2021-07-07 16:50 脂环 阅读(40) 评论(0) 推荐(0) 编辑
摘要:Prof. Pang plays chess against his rival Prof. Shou. They are the only two players in the game. The chessboard is very large and can be viewed as a 2D 阅读全文
posted @ 2021-05-12 23:31 脂环 阅读(471) 评论(0) 推荐(1) 编辑
摘要:Phoenix has a string ss consisting of lowercase Latin letters. He wants to distribute all the letters of his string into kk non-empty strings a1,a2,…, 阅读全文
posted @ 2020-05-02 15:13 脂环 阅读(334) 评论(0) 推荐(0) 编辑
摘要:Writing light novels is the most important thing in Linova's life. Last night, Linova dreamed about a fantastic kingdom. She began to write a light no 阅读全文
posted @ 2020-04-16 11:18 脂环 阅读(307) 评论(0) 推荐(0) 编辑
摘要:题目描述 You have n n n students under your control and you have to compose exactly two teams consisting of some subset of your students. Each student had 阅读全文
posted @ 2020-04-14 09:32 脂环 阅读(449) 评论(0) 推荐(0) 编辑
摘要:You have array of nn numbers a1,a2,…,ana1,a2,…,an . Rearrange these numbers to satisfy |a1−a2|≤|a2−a3|≤…≤|an−1−an||a1−a2|≤|a2−a3|≤…≤|an−1−an| , where 阅读全文
posted @ 2020-04-13 10:50 脂环 阅读(251) 评论(0) 推荐(0) 编辑
摘要:Many years ago Berland was a small country where only nn people lived. Each person had some savings: the ii -th one had aiai burles. The government co 阅读全文
posted @ 2020-04-11 11:48 脂环 阅读(323) 评论(0) 推荐(0) 编辑
摘要:Advanced CPU Manufacturer (ACM) is one of the best CPU manufacturer in the world. Every day, they manufacture n CPU chips and sell them all over the w 阅读全文
posted @ 2020-03-30 20:11 脂环 阅读(156) 评论(0) 推荐(0) 编辑
摘要:有时候快排/归并之类并不简简单单只是排序,比如快排可以求第k大,归并在部分已排序的情况下效率较高不容易被卡~ #include <bits/stdc++.h> using namespace std; void merge(int a[], int l, int r, int mid) { int 阅读全文
posted @ 2020-03-29 20:06 脂环 阅读(131) 评论(0) 推荐(0) 编辑
摘要:The next lecture in a high school requires two topics to be discussed. The ii -th topic is interesting by aiai units for the teacher and by bibi units 阅读全文
posted @ 2020-03-29 00:42 脂环 阅读(251) 评论(0) 推荐(0) 编辑
摘要:output standard output You are given an array aa of length nn . You are also given a set of distinct positions p1,p2,…,pmp1,p2,…,pm , where 1≤pi<n1≤pi 阅读全文
posted @ 2020-02-27 18:35 脂环 阅读(276) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示
主题色彩