随笔分类 - 思维
摘要:D - Handstand Time Limit: 2 sec / Memory Limit: 1024 MB Score : 400400 points Problem Statement NN people are arranged in a row from left to right. Yo
阅读全文
摘要:链接:https://ac.nowcoder.com/acm/contest/560/D来源:牛客网 题目描述 Give you a rectangular gird which is h cells high and w cells wide. Each grid is black initial
阅读全文
摘要:Let's suppose you have an array a, a stack s (initially empty) and an array b (also initially empty). You may perform the following operations until b
阅读全文
摘要:You are given an integer array of length nn. You have to choose some subsequence of this array of maximum length such that this subsequence forms a in
阅读全文
摘要:You are given a sequence of integers of length nn and integer number kk. You should print any integer number xx in the range of [1;109][1;109] (i.e. 1
阅读全文
摘要:Polycarp likes to play with numbers. He takes some integer number xx, writes it down on the board, and then performs with it n−1n−1 operations of the
阅读全文
摘要:Country of Metropolia is holding Olympiad of Metrpolises soon. It mean that all jury members of the olympiad should meet together in Metropolis (the c
阅读全文
摘要:Petya studies at university. The current academic year finishes with nn special days. Petya needs to pass mm exams in those special days. The special
阅读全文
摘要:The busses in Berland are equipped with a video surveillance system. The system records information about changes in the number of passengers in a bus
阅读全文
摘要:You are given a connected undirected graph consisting of nn vertices and mm edges. There are no self-loops or multiple edges in the given graph. You h
阅读全文
摘要:历届试题 小朋友排队 时间限制:1.0s 内存限制:256.0MB 问题描述 n 个小朋友站成一排。现在要把他们按身高从低到高的顺序排列,但是每次只能交换位置相邻的两个小朋友。 每个小朋友都有一个不高兴的程度。开始的时候,所有小朋友的不高兴程度都是0。 如果某个小朋友第一次被要求交换,则他的不高兴程
阅读全文
摘要:问题如下:先给你一个含有N个整数的数组数组中的每一个元素只为1或者0而N的大小为1~100你可以删除一些元素(也可以选择不删除),使剩下的数组中,没有一个元素0在1后面出现。并且要使剩下的元素的数量最多,请输出剩下元素的数量。 思路: 没有一个元素0在1后面出现,。 那么操作后的数组只可能是这个样子
阅读全文
摘要:E. Magic Stones time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output E. Magic Stones time limi
阅读全文
摘要:B. Makes And The Product time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output B. Makes And Th
阅读全文
摘要:You have a garland consisting of nn lamps. Each lamp is colored red, green or blue. The color of the ii-th lamp is sisi ('R', 'G' and 'B' — colors of
阅读全文
摘要:You are given two segments [l1;r1][l1;r1] and [l2;r2][l2;r2] on the xx-axis. It is guaranteed that l1<r1l1<r1 and l2<r2l2<r2. Segments may intersect,
阅读全文
摘要:Emily the entrepreneur has a cool business idea: packaging and selling snowflakes. She has devised a machine that captures snowflakes as they fall, an
阅读全文
摘要:D. Game with modulo time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output D. Game with modulo t
阅读全文
摘要:D. Vladik and Favorite Game time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output D. Vladik an
阅读全文
摘要:链接:https://ac.nowcoder.com/acm/contest/358/A来源:牛客网 题目描述 众所周知,每个人都有自己的rp值(是个非负实数),膜别人可以从别人身上吸取rp值。 然而当你膜别人时,别人也会来膜你,互膜一段时间后,你们就平分了两人原有的rp值,当你膜过一个人之后,你就
阅读全文

浙公网安备 33010602011771号