随笔分类 -  算法基础—思维题

摘要:Today is Jaime’s birthday and, to celebrate, his friends ordered a cake decorated with eggfruits and persimmons. When the cake arrived, to their surpr 阅读全文
posted @ 2020-09-30 22:02 脂环 阅读(141) 评论(0) 推荐(0) 编辑
摘要:You are given an array a consisting of n integers numbered from 1to n . Let's define the k -amazing number of the array as the minimum number that occ 阅读全文
posted @ 2020-09-28 20:28 脂环 阅读(366) 评论(0) 推荐(1) 编辑
摘要:You are given a binary string s consisting of n zeros and ones. Your task is to divide the given string into the minimum number of subsequences in suc 阅读全文
posted @ 2020-08-07 15:26 脂环 阅读(315) 评论(0) 推荐(0) 编辑
摘要:You have n gifts and you want to give all of them to children. Of course, you don't want to offend anyone, so all gifts should be equal between each o 阅读全文
posted @ 2020-08-07 14:34 脂环 阅读(661) 评论(1) 推荐(1) 编辑
摘要:Problem Description You are given two 10-based integers b and x, and you are required to determine the following proposition is true or false: For arb 阅读全文
posted @ 2020-08-06 21:35 脂环 阅读(294) 评论(0) 推荐(1) 编辑
摘要:The length of the longest common prefix of two strings s=s1s2sn and t=t1t2tm is defined as the maximum integer k0≤k≤min*(n,*m)) such 阅读全文
posted @ 2020-08-02 21:54 脂环 阅读(216) 评论(0) 推荐(0) 编辑
摘要:Zhang3 a participant of IPhO (Immortal Physics Olympiad). The 0^\mathrm problem in the contest is as follows. There are two balls that weigh a k 阅读全文
posted @ 2020-07-30 20:07 脂环 阅读(278) 评论(0) 推荐(0) 编辑
摘要:#include <bits/stdc++.h> using namespace std; int a[1005][1005] = {0}, n, m; int main() { int t; cin >> t; while(t--) { memset(a, 0, sizeof(a)); cin > 阅读全文
posted @ 2020-07-22 22:08 脂环 阅读(752) 评论(0) 推荐(0) 编辑
摘要:Problem Description S is a string of length n. S consists of lowercase English alphabets. Your task is to count the number of different S with the min 阅读全文
posted @ 2020-07-21 18:54 脂环 阅读(437) 评论(0) 推荐(0) 编辑
摘要:You are given three positive (i.e. strictly greater than zero) integers xx , yy and zz . Your task is to find positive integers aa , bb and cc such th 阅读全文
posted @ 2020-07-18 16:47 脂环 阅读(510) 评论(0) 推荐(0) 编辑
摘要:Cuber QQ 长期在网络上与他人对线,一天,他发明了一台神奇的打字机。这台打字机只能处理由 a,b,X 构成的字符串。具体来说,打字机能够执行如下三种操作。 • 操作1:将任意一个 X 替换为 aX 。 • 操作2:将任意一个 X 替换为 aXbX 。 • 操作3:删除任意一个 X 。 打字机启 阅读全文
posted @ 2020-07-18 10:50 脂环 阅读(205) 评论(0) 推荐(0) 编辑
摘要:B. 与矩阵 单点时限: 1.0 sec 内存限制: 512 MB 前有牛顿瘟疫“家里蹲”发明微积分。 现有 Cuber QQ 新冠肺炎“家里蹲”发明与矩阵。 与矩阵是一个 n×n 的矩阵。规定矩阵中的第 i 行第 j 列记为 (i,j) 。 生成一个与矩阵的方式是,先生成一个长度为 n 的数列 a 阅读全文
posted @ 2020-07-17 00:31 脂环 阅读(211) 评论(0) 推荐(0) 编辑
摘要:Tom and Jerry are going on a vacation. They are now driving on a one-way road and several cars are in front of them. To be more specific, there are nn 阅读全文
posted @ 2020-07-16 23:37 脂环 阅读(156) 评论(0) 推荐(0) 编辑
摘要:Recently, you found a bot to play "Rock paper scissors" with. Unfortunately, the bot uses quite a simple algorithm to play: he has a string s=s1s2…sns 阅读全文
posted @ 2020-07-14 08:32 脂环 阅读(368) 评论(0) 推荐(0) 编辑
摘要:Patrick likes to play baseball, but sometimes he will spend so many hours hitting home runs that his mind starts to get foggy! Patrick is sure that hi 阅读全文
posted @ 2020-07-13 15:34 脂环 阅读(235) 评论(0) 推荐(0) 编辑
摘要:The last contest held on Johnny's favorite competitive programming platform has been received rather positively. However, Johnny's rating has dropped 阅读全文
posted @ 2020-06-07 21:37 脂环 阅读(300) 评论(0) 推荐(0) 编辑
摘要:Johnny has recently found an ancient, broken computer. The machine has only one register, which allows one to put in there one variable. Then in one o 阅读全文
posted @ 2020-06-07 21:31 脂环 阅读(282) 评论(0) 推荐(0) 编辑
摘要:Ayush and Ashish play a game on an unrooted tree consisting of nn nodes numbered 11 to nn. Players make the following move in turns: Select any leaf n 阅读全文
posted @ 2020-06-01 20:43 脂环 阅读(306) 评论(0) 推荐(1) 编辑
摘要:Shubham has a binary string ss. A binary string is a string containing only characters "0" and "1". He can perform the following operation on the stri 阅读全文
posted @ 2020-06-01 10:48 脂环 阅读(503) 评论(0) 推荐(0) 编辑
摘要:A. Odd Selection time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Shubham has an array aa 阅读全文
posted @ 2020-06-01 10:44 脂环 阅读(471) 评论(0) 推荐(0) 编辑

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