
ACM
「已注销」
敲代码本身就是一件欲罢不能的事情
展开
-
131A- cAPS lOCK(正则表达式)
ProblemwHAT DO WE NEED cAPS LOCK FOR?Caps lock is a computer keyboard key. Pressing it sets an input mode in which typed letters are capital by default. If it is pressed by accident, it leads to acc...原创 2018-12-25 16:37:24 · 364 阅读 · 0 评论 -
1082A--Vasya and Book
题目Vasya is reading a e-book. The file of the book consists of n pages, numbered from 1 to n. The screen is currently displaying the contents of page x, and Vasya wants to read the page y. There are t...原创 2018-11-29 01:26:19 · 205 阅读 · 0 评论 -
(ACM) u Calculate e
Problem DescriptionA simple mathematical formula for e is where n is allowed to go to infinity. This can actually yield very accurate approximations of e using relatively small values of n.OutputOu原创 2017-11-20 12:32:45 · 254 阅读 · 0 评论 -
(ACM)Let the Balloon Rise
Problem DescriptionContest time again! How excited it is to see balloons floating around. But to tell you a secret, the judges’ favorite time is guessing the most popular problem. When the contest is o原创 2017-11-27 20:54:30 · 259 阅读 · 0 评论 -
(ACM)Number Sequence
Problem DescriptionA number sequence is defined as follows:f(1) = 1, f(2) = 1, f(n) = (A * f(n - 1) + B * f(n - 2)) mod 7.Given A, B, and n, you are to calculate the value of f(n).InputThe input consis原创 2017-11-27 21:14:05 · 265 阅读 · 0 评论 -
NYOJ--71 独木舟上的旅行
描述进行一次独木舟的旅行活动,独木舟可以在港口租到,并且之间没有区别。一条独木舟最多只能乘坐两个人,且乘客的总重量不能超过独木舟的最大承载量。我们要尽量减少这次活动中的花销,所以要找出可以安置所有旅客的最少的独木舟条数。现在请写一个程序,读入独木舟的最大承载量、旅客数目和每位旅客的重量。根据给出的规则,计算要安置所有旅客必须的最少的独木舟条数,并输出结果。输入第一行输入s,表示测试...原创 2018-09-10 22:45:32 · 196 阅读 · 0 评论 -
NYOJ--6 喷水装置(一)
描述现有一块草坪,长为20米,宽为2米,要在横中心线上放置半径为Ri的喷水装置,每个喷水装置的效果都会让以它为中心的半径为实数Ri(0输入第一行m表示有m组测试数据 每一组测试数据的第一行有一个整数数n,n表示共有n个喷水装置,随后的一行,有n个实数ri,ri表示该喷水装置能覆盖的圆的半径。输出输出所用装置的个数样例输入252 3.2 4 4.5 6 10...原创 2018-09-10 23:18:36 · 193 阅读 · 0 评论 -
nyoj--14 会场安排问题
描述学校的小礼堂每天都会有许多活动,有时间这些活动的计划时间会发生冲突,需要选择出一些活动进行举办。小刘的工作就是安排学校小礼堂的活动,每个时间最多安排一个活动。现在小刘有一些活动计划的时间表,他想尽可能的安排更多的活动,请问他该如何安排。输入第一行是一个整型数m(m<100)表示共有m组测试数据。 每组测试数据的第一行是一个整数n(1输出对于每一组输入,输出最多能够安...原创 2018-09-10 23:34:33 · 393 阅读 · 0 评论 -
河南省第十一届ACM大赛 A 计划日
描述为什么花那么多时间、精力还是学不好学不通,如何把握各科目的重难点,期中和期末如何梳理本学期各知识点及内部联系……在孩子学习的过程中,我们该如何帮助孩子快速提高成绩呢? 打造名校进阶计划,让孩子会学习、会考试,实现名校梦想! Dr. Kong, 作为一名从教多年的老师,跟踪了大量成绩好的学生,发现他们的学习习惯非常规律,有方法、有计划、有目标、有总结。比如:已考上**大学的李明同学,...原创 2018-09-10 23:45:38 · 253 阅读 · 1 评论 -
NYOJ--12 喷水装置(二)
描述有一块草坪,横向长w,纵向长为h,在它的橫向中心线上不同位置处装有n(n<=10000)个点状的喷水装置,每个喷水装置i喷水的效果是让以它为中心半径为Ri的圆都被润湿。请在给出的喷水装置中选择尽量少的喷水装置,把整个草坪全部润湿。输入第一行输入一个正整数N表示共有n次测试数据。 每一组测试数据的第一行有三个整数n,w,h,n表示共有n个喷水装置,w表示草坪的横向长度,h表示...原创 2018-09-11 21:10:06 · 181 阅读 · 0 评论 -
1082B--Vova and Trophies
题目Vova has won n trophies in different competitions. Each trophy is either golden or silver. The trophies are arranged in a row.The beauty of the arrangement is the length of the longest subsegment ...原创 2018-12-04 18:07:51 · 271 阅读 · 0 评论 -
1089A--Lazyland
题目The kingdom of Lazyland is the home to n idlers. These idlers are incredibly lazy and create many problems to their ruler, the mighty King of Lazyland.Today k important jobs for the kingdom (k≤n) ...原创 2018-12-03 09:13:46 · 1341 阅读 · 0 评论 -
NowCoder--被打脸的潇洒哥
题目 链接:https://ac.nowcoder.com/acm/contest/318/M“画个圈圈诅咒你!”在一次青青草原ACM个人赛中,潇洒哥被喜洋洋以30s罚时压制,委屈的当了个第二。潇洒哥蹲在角落说出了他的口头禅,并画起了圈圈。突然,他想出了一个有趣的题目,跑去给喜洋洋做。喜洋洋看到题目后懵逼了,但是看到潇洒哥脸上欠揍的笑容就不爽,暗想一定要做出来狠狠的打潇洒哥的脸。于是,他以...原创 2018-12-23 18:37:39 · 272 阅读 · 0 评论 -
NowCoder--送气球
题目链接:https://ac.nowcoder.com/acm/contest/318/AACM-ICPC程序设计大赛是大学级别最高的脑力竞赛,素来被冠以"程序设计的奥林匹克"的尊称。大赛至今已有近40年的历史,是世界范围内历史最悠久、规模最大的程序设计竞赛。比赛形式是:从各大洲区域预赛出线的参赛队伍,于指定的时间、地点参加世界级的决赛,由1个教练、3个成员组成的小组应用一台计算机解决7到13...原创 2018-12-23 18:28:26 · 229 阅读 · 0 评论 -
Java中BigDecimal类及8种舍入模式
Java在java.math包中提供的API类BigDecimal,用于对超过16位有效位的数进行精确的运算。双精度浮点型变量double可以处理16位有效数。在应用中,需要对更大或者更小的数进行运算和处理。float和double只能用来做科学计算或工程计算,在商业计算中要用java.math.BigDecimal。BigDecimal所创建的是对象,我们不能使用传统的+、-、*、/等算术运算符...原创 2018-12-23 17:49:53 · 308 阅读 · 0 评论 -
NowCode--抢课了
题目链接:https://ac.nowcoder.com/acm/contest/321/B没有选上课的孩子,或者还有?”“救救孩子……”又又又到了选修课抢课的时间了!集训队成员全心备战亚洲区域赛,居然忘记了选课.缓过神来的集训队成员现在很想知道,每门课人数从小到大的排序结果是什么.Wty主席这时微微一笑,早已看穿了一切.他早就实时爬取了每一个学生所选的课程列表,现在只需要简单的统计...原创 2018-12-22 22:12:08 · 659 阅读 · 0 评论 -
122A-- Lucky Division
题目Petya loves lucky numbers. Everybody knows that lucky numbers are positive integers whose decimal representation contains only the lucky digits 4 and 7. For example, numbers 47, 744, 4 are lucky an...原创 2018-12-17 11:51:53 · 294 阅读 · 0 评论 -
蓝桥--方格填数
题目如图,如下的10个格子,填入0~9的数字。要求:连续的两个数字不能相邻。(左右、上下、对角都算相邻)一共有多少种可能的填数方案?解题思路,先利用全排列方法,计算出每一种排列,然后再判断每一种排列是否符合题意要求...原创 2018-12-27 11:36:39 · 402 阅读 · 0 评论 -
NowCoder--Protoss and Zerg
题目链接:https://ac.nowcoder.com/acm/contest/303/H来源:牛客网1v1,是星际争霸(StarCraft)中最常见的竞技模式。tokitsukaze进行了n场1v1。在每一场的1v1中,她都有星灵(Protoss)和异虫(Zerg)两个种族可以选择,分别有a个单位和b个单位。因为tokitsukaze不太擅长玩人类(Terran),所以她肯定不会选择人...原创 2018-12-08 23:05:07 · 243 阅读 · 0 评论 -
1088B--Ehab and subtraction
题目You’re given an array a. You should repeat the following operation k times: find the minimum non-zero element in the array, print it, and then subtract it from all the non-zero elements of the arra...原创 2018-12-05 22:22:39 · 244 阅读 · 0 评论 -
NowCoder--Race Sorting
题目链接:https://ac.nowcoder.com/acm/contest/303/I来源:牛客网星际争霸(StarCraft)是暴雪公司制作发行的一款即时战略游戏。游戏描述了26世纪初期,位于银河系中心的三个种族在克普鲁星际空间中争夺霸权的故事。三个种族分别是:人类(Terran),异虫(Zerg),星灵(Protoss)。现在tokitsukaze拥有n个单位,每个单位的编号是1...原创 2018-12-08 21:29:56 · 202 阅读 · 0 评论 -
NYOJ--47 过河问题
描述在漆黑的夜里,N位旅行者来到了一座狭窄而且没有护栏的桥边。如果不借助手电筒的话,大家是无论如何也不敢过桥去的。不幸的是,N个人一共只带了一只手电筒,而桥窄得只够让两个人同时过。如果各自单独过桥的话,N人所需要的时间已知;而如果两人同时过桥,所需要的时间就是走得比较慢的那个人单独行动时所需的时间。问题是,如何设计一个方案,让这N人尽快过桥。输入第一行是一个整数T(1<=T&lt...原创 2018-09-11 23:28:07 · 361 阅读 · 0 评论 -
ACM-ICPC 2018 焦作赛区网络预赛--A. Magic Mirror
描述Jessie has a magic mirror.Every morning she will ask the mirror: ‘Mirror mirror tell me, who is the most beautiful girl in the world?’ If the mirror says her name, she will praise the mirror: ‘G...原创 2018-09-17 10:10:29 · 296 阅读 · 0 评论 -
959B—Mahmoud and Ehab and the message
题目Mahmoud wants to send a message to his friend Ehab. Their language consists of n words numbered from 1 to n. Some words have the same meaning so there are k groups of words such that all the words ...原创 2018-11-01 20:32:52 · 270 阅读 · 0 评论 -
959D--Mahmoud and Ehab and another array construction task
题目Mahmoud has an array a consisting of n integers. He asked Ehab to find another array b of the same length such that:b is lexicographically greater than or equal to a.bi ≥ 2.b is pairwise coprime...原创 2018-11-07 21:37:06 · 250 阅读 · 0 评论 -
26A--Almost Prime
题目A number is called almost prime if it has exactly two distinct prime divisors. For example, numbers 6, 18, 24 are almost prime, while 4, 8, 9, 42 are not. Find the amount of almost prime numbers wh...原创 2018-11-12 20:08:10 · 334 阅读 · 0 评论 -
26B--Regular Bracket Sequence
题目A bracket sequence is called regular if it is possible to obtain correct arithmetic expression by inserting characters «+» and «1» into this sequence. For example, sequences «(())()», «()» and «(()...原创 2018-11-12 21:13:40 · 653 阅读 · 0 评论 -
45A--Codecraft III
题目Today Vasya visited a widely known site and learned that the continuation of his favourite game Codecraft II will appear after exactly k months. He looked at the calendar and learned that at the mo...原创 2018-11-17 13:30:17 · 360 阅读 · 0 评论 -
45D--Event Dates
题目On a history lesson the teacher asked Vasya to name the dates when n famous events took place. He doesn’t remembers the exact dates but he remembers a segment of days [li, ri] (inclusive) on which ...原创 2018-11-18 14:43:29 · 369 阅读 · 0 评论 -
45F-- Goats and Wolves
题目Once Vasya needed to transport m goats and m wolves from riverbank to the other as quickly as possible. The boat can hold n animals and Vasya, in addition, he is permitted to put less than n animal...原创 2018-11-18 17:48:13 · 382 阅读 · 0 评论 -
1079A--Kitchen Utensils
题目The king’s birthday dinner was attended by k guests. The dinner was quite a success: every person has eaten several dishes (though the number of dishes was the same for every person) and every dish...原创 2018-11-19 20:41:57 · 841 阅读 · 0 评论 -
1079C--Playing Piano
题目Little Paul wants to learn how to play piano. He already has a melody he wants to start with. For simplicity he represented this melody as a sequence a1,a2,…,an of key numbers: the more a number is...原创 2018-11-21 20:52:25 · 232 阅读 · 0 评论 -
959A--Mahmoud and Ehab and the even-odd game
题目Mahmoud and Ehab play a game called the even-odd game. Ehab chooses his favorite integer n and then they take turns, starting from Mahmoud. In each player’s turn, he has to choose an integer a and ...原创 2018-10-30 20:16:17 · 239 阅读 · 0 评论 -
961B--Lecture Sleep
题目Your friend Mishka and you attend a calculus lecture. Lecture lasts n minutes. Lecturer tells ai theorems during the i-th minute.Mishka is really interested in calculus, though it is so hard to st...原创 2018-10-29 21:36:40 · 410 阅读 · 0 评论 -
NYOJ824--Greedy Mouse
描述A fat mouse prepared M pounds of cat food,ready to trade with the cats guarding the warehouse containing hisfavorite food:peanut. The warehouse has N rooms.The ith room containsW[i] pounds of pean...原创 2018-09-17 21:13:41 · 191 阅读 · 0 评论 -
NYOJ106--背包问题
描述现在有很多物品(它们是可以分割的),我们知道它们每个物品的单位重量的价值v和重量w(1<=v,w<=10);如果给你一个背包它能容纳的重量为m(10<=m<=20),你所要做的就是把物品装到背包里,使背包里的物品的价值总和最大。输入第一行输入一个正整数n(1<=n<=5),表示有n组测试数据;随后有n测试数据,每组测试数据的第一行有两个正整数s,m(...原创 2018-09-19 20:47:39 · 169 阅读 · 0 评论 -
NYOJ91--阶乘之和
描述给你一个非负数整数n,判断n是不是一些数(这些数不允许重复使用,且为正数)的阶乘之和,如9=1!+2!+3!,如果是,则输出Yes,否则输出No;输入第一行有一个整数0<m<100,表示有m组测试数据;每组测试数据有一个正整数n<1000000;输出如果符合条件,输出Yes,否则输出No;样例输入2910样例输出YesNoAC-Codeimp...原创 2018-09-25 20:09:30 · 250 阅读 · 0 评论 -
NYOJ586--疯牛
描述农夫 John 建造了一座很长的畜栏,它包括N (2 <= N <= 100,000)个隔间,这些小隔间依次编号为x1,…,xN (0 <= xi <= 1,000,000,000).但是,John的C (2 <= C <= N)头牛们并不喜欢这种布局,而且几头牛放在一个原创 2018-09-26 23:55:51 · 264 阅读 · 1 评论 -
NYOJ 236--心急的C小加
描述C小加有一些木棒,它们的长度和质量都已经知道,需要一个机器处理这些木棒,机器开启的时候需要耗费一个单位的时间,如果第i+1个木棒的重量和长度都大于等于第i个处理的木棒,那么将不会耗费时间,否则需要消耗一个单位的时间。因为急着去约会,C小加想在最短的时间内把木棒处理完,你能告诉他应该怎样做吗?输入第一行是一个整数T(1<T<1500),表示输入数据一共有T组。每组测试数据的第...原创 2018-10-08 23:24:42 · 140 阅读 · 0 评论 -
CF--1A Theatre Square
Theatre Square in the capital city of Berland has a rectangular shape with the size n × m meters. On the occasion of the city’s anniversary, a decision was taken to pave the Square with square granite...原创 2018-10-15 20:02:06 · 198 阅读 · 0 评论