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

摘要:It's a sunny day with good scenery, and you come to the park for a walk. You feel curious that there are many old guys gathering by a bridge, and want 阅读全文
posted @ 2021-05-11 22:47 脂环 阅读(140) 评论(0) 推荐(0) 编辑
摘要:You are playing the game "Arranging The Sheep". The goal of this game is to make the sheep line up. The level in the game is described by a string of 阅读全文
posted @ 2021-05-06 19:02 脂环 阅读(254) 评论(0) 推荐(0) 编辑
摘要:链接:https://ac.nowcoder.com/acm/problem/105660 来源:牛客网 题目描述 This puzzle consists of a random sequence of m black disks and n white disks on an oval-shap 阅读全文
posted @ 2021-05-04 15:36 脂环 阅读(74) 评论(0) 推荐(0) 编辑
摘要:链接:https://ac.nowcoder.com/acm/contest/15590/L 来源:牛客网 题目描述 输入描述: 输出描述: 示例1 输入 复制 7 4 2 6 1 5 7 3 输出 复制 337 34 3401 7 780 7803 79 示例2 输入 复制 4 4 1 3 2 输 阅读全文
posted @ 2021-05-02 21:32 脂环 阅读(85) 评论(0) 推荐(0) 编辑
摘要:You have r red and b blue beans. You'd like to distribute them among several (maybe, one) packets in such a way that each packet: has at least one red 阅读全文
posted @ 2021-04-30 09:01 脂环 阅读(454) 评论(0) 推荐(0) 编辑
摘要:Baby Ehab was toying around with arrays. He has an array a of length n. He defines an array to be good if there's no way to partition it into 2 subseq 阅读全文
posted @ 2021-04-29 21:13 脂环 阅读(123) 评论(0) 推荐(0) 编辑
摘要:You are given three integers a, 𝑏b and c. Find two positive integers x and y (x>0, y>0) such that: the decimal representation of x without leading ze 阅读全文
posted @ 2021-04-14 14:27 脂环 阅读(132) 评论(0) 推荐(0) 编辑
摘要:You have a card deck of n cards, numbered from top to bottom, i. e. the top card has index 1and bottom card — index n. Each card has its color: the 𝑖 阅读全文
posted @ 2021-04-14 13:24 脂环 阅读(95) 评论(0) 推荐(0) 编辑
摘要:链接:https://ac.nowcoder.com/acm/contest/12548/J 来源:牛客网 题目描述 As a master of parallel computing, schwer is recently considering about the method to achie 阅读全文
posted @ 2021-04-06 12:01 脂环 阅读(337) 评论(0) 推荐(0) 编辑
摘要:给你一个字符串表达式 s ,请你实现一个基本计算器来计算并返回它的值。 整数除法仅保留整数部分。 示例 1: 输入:s = "3+2*2" 输出:7 示例 2: 输入:s = " 3/2 " 输出:1 示例 3: 输入:s = " 3+5 / 2 " 输出:5 这个题实际上考的是字符串处理。。。 对 阅读全文
posted @ 2021-03-11 18:40 脂环 阅读(96) 评论(0) 推荐(0) 编辑
摘要:You are given a multiset S initially consisting of n distinct non-negative integers. A multiset is a set, that can contain some elements multiple time 阅读全文
posted @ 2021-03-10 23:10 脂环 阅读(276) 评论(0) 推荐(0) 编辑
摘要:A. Split it! Kawashiro Nitori is a girl who loves competitive programming. One day she found a string and an integer. As an advanced problem setter, s 阅读全文
posted @ 2021-03-10 23:05 脂环 阅读(190) 评论(0) 推荐(0) 编辑
摘要:A. 回文括号序列计数 坑比题...注意回文的定义,并不是括号序列对称。比如(())不是回文的而))是回文的。而合法括号列左右两端一定是(和),必然非回文,因此只有空串答案是1. #include <iostream> using namespace std; #define mod 9982443 阅读全文
posted @ 2021-02-24 20:38 脂环 阅读(88) 评论(0) 推荐(0) 编辑
摘要:Educational Codeforces Round 104 (Rated for Div. 2) A~D A. Arena 除去最少的那部分以外都对答案有贡献。 #include <iostream> #include <algorithm> #include <set> using name 阅读全文
posted @ 2021-02-17 16:01 脂环 阅读(116) 评论(0) 推荐(0) 编辑
摘要:链接:https://ac.nowcoder.com/acm/contest/9982/F 来源:牛客网 牛牛有一个数组,数组元素是1到n的排列,即数组的值在1~n范围内,且每个数字仅出现1次。 牛牛想要将该数组变为升序排列的,他可以进行如下的操作。 首先他要确定一个长度k,k的范围在1~n之间。 阅读全文
posted @ 2021-02-03 21:24 脂环 阅读(168) 评论(0) 推荐(0) 编辑
摘要:https://ac.nowcoder.com/acm/contest/11746 好久没写过代码了,思维能力下降,爬了 A. 切蛋糕 待补 B. 小宝的幸运数组 套路题,初始化tmp为0,从头遍历一遍数组,用tmp加上当前a[i]再对k取模,如果有两个位置得到的模数一样,说明这一段的和就是k的倍数 阅读全文
posted @ 2021-01-30 20:33 脂环 阅读(178) 评论(0) 推荐(0) 编辑
摘要:In computer science, a binary tree is a rooted tree in which each node has at most two children. In this problem, let's denote 𝑛n as the number of no 阅读全文
posted @ 2020-12-15 16:16 脂环 阅读(99) 评论(0) 推荐(0) 编辑
摘要:Binary Search Andrey thinks he is truly a successful developer, but in reality he didn't know about the binary search algorithm until recently. After 阅读全文
posted @ 2020-10-25 00:36 脂环 阅读(404) 评论(0) 推荐(0) 编辑
摘要:Boring Apartments 模拟 #include <iostream> using namespace std; int main() { //freopen("data.txt", "r", stdin); int t; cin >> t; while(t--) { int x; cin 阅读全文
posted @ 2020-10-21 20:05 脂环 阅读(193) 评论(0) 推荐(0) 编辑
摘要:题目描述 Garrison and Anderson are working in a company named “Adjustment Office”. In competing companies workers change the reality, in this company they 阅读全文
posted @ 2020-10-07 15:50 脂环 阅读(144) 评论(0) 推荐(0) 编辑

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