![](https://img-blog.csdnimg.cn/20201014180756926.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
oj
文章平均质量分 77
昆libra
这个作者很懒,什么都没留下…
展开
-
17年网易笔试-跳石板:广度优先搜索
前言17年网易笔试有一道编程题目《跳石板》,newcoder OJ链接如下: 跳石板-牛客网 题目描述如下: 小易来到了一条石板路前,每块石板上从1挨着编号为:1、2、3……. 这条石板路要根据特殊的规则才能前进:对于小易当前所在的编号为K的 石板,小易单次只能往前跳K的一个约数(不含1和K)步,即跳到K+X(X为K的一个非1和本身的约数)的位置。 小易当前处在编号为N的石板,他想跳到原创 2016-09-14 22:01:46 · 2039 阅读 · 0 评论 -
zoj1051--------A New Growth Industry 细菌~
把数组中的一个数,与其上下左右的四个数相加,得到的数值对应到DNA序列里面的对应数,把这个对应数加到原数组的对应位置,然后超过三的为3,低于零的为0,处理后,即为一天的变化情况。比如:3 0 0 3 3 0 4 1 0 3 1 00 0 0 —— 3 0 0 —— 1 0 0 —— 1 0 0原创 2012-07-31 16:12:55 · 1288 阅读 · 0 评论 -
zoj1115-----------Digital Roots
BackgroundThe digital root of a positive integer is found by summing the digits of the integer. If the resulting value is a single digit then that digit is the digital root. If the resulting value原创 2012-07-31 18:40:55 · 451 阅读 · 0 评论 -
zoj1813--------------Biker's Trip Odometer
Most bicycle speedometers work by using a Hall Effect sensor fastened to the front fork of the bicycle. A magnet is attached to one of the spokes on the front wheel so that it will line up with the原创 2012-08-10 09:50:14 · 849 阅读 · 0 评论 -
zoj2988--------------Conversions
Conversion between the metric and English measurement systems is relatively simple. Often, it involves either multiplying or dividing by a constant. You must write a program that converts between th原创 2012-08-09 19:36:37 · 494 阅读 · 0 评论 -
zoj2883----------------------Shopaholic
Lindsay is a shopaholic. Whenever there is a discount of the kind where you can buy three items and only pay for two, she goes completely mad and feels a need to buy all items in the store. You have原创 2012-08-09 16:42:22 · 457 阅读 · 0 评论 -
zoj2878------------------Parking
When shopping on Long Street, Michael usually parks his car at some random location, and then walks to the stores he needs. Can you help Michael choose a place to park which minimises the distance h原创 2012-08-09 16:24:01 · 440 阅读 · 0 评论 -
BNUOJ 26190 --------------- In Braille
The Braille system, designed by Louis Braille in 1825, revolutionized written communication for blind and visually impaired persons. Braille, a blind Frenchman, developed a tactile language where each原创 2012-08-15 21:22:20 · 598 阅读 · 0 评论 -
BNUOJ 26192------------King's Poker
Poker is one of the most widely played card games, and King's Poker is one of its variations. The game is played with a normal deck of 52 cards. Each card has one of 4 suits and one of 13 ranks. Howev原创 2012-08-15 21:25:39 · 910 阅读 · 0 评论 -
zoj2099------------------------Frame Polygonal Line
You are going to read a sequence of pairs of integer numbers. Each pair represents the Cartesian coordinates of a point in a 2-dimentional plane. The first number is the x coordinate, while the seco原创 2012-08-21 21:07:18 · 897 阅读 · 0 评论 -
zoj2405 ------------Specialized Four-Digit Numbers
Find and list all four-digit numbers in decimal notation that have the property that the sum of its four digits equals the sum of its digits when represented in hexadecimal (base 16) notation and al原创 2012-08-20 17:00:49 · 537 阅读 · 0 评论 -
zoj2812-----------------Quicksum
A checksum is an algorithm that scans a packet of data and returns a single number. The idea is that if the packet is changed, the checksum will also change, so checksums are often used for detectin原创 2012-08-20 15:47:22 · 528 阅读 · 0 评论 -
zoj2807
#include using namespace std;int main(){ int T; cin>>T; while (T--) { int N; cin>>N; int sum=0; while (N--) { int x; cin>>x; sum=sum+x-1; } cout<<sum+1<<endl; } re原创 2012-08-20 09:24:42 · 390 阅读 · 0 评论 -
zoj2388----------------Beat the Spread!
Superbowl Sunday is nearly here. In order to pass the time waiting for the half-time commercials and wardrobe malfunctions, the local hackers have organized a betting pool on the game. Members place原创 2012-08-20 20:11:14 · 972 阅读 · 0 评论 -
zoj1949-------------Error Correction
A boolean matrix has the parity property when each row and each column has an even sum, i.e. contains an even number of bits which are set. Here's a 4 x 4 matrix which has the parity property:1 0原创 2012-08-18 16:21:01 · 483 阅读 · 0 评论 -
zoj1915--------------------Above Average
It is said that 90% of frosh expect to be above average in their class. You are to provide a reality check.InputThe first line of standard input contains an integer C, the number of test cases.原创 2012-08-18 15:47:52 · 404 阅读 · 0 评论 -
zoj1201--------Inversion
Let { A1,A2,...,An } be a permutation of the set{ 1,2,..., n}. If i Aj then the pair (Ai,Aj) is called an "inversion" of the permutation. For example, the permutation {3, 1, 4, 2} has three inversion原创 2012-08-01 16:10:55 · 900 阅读 · 0 评论 -
zoj2782------------------Q
IntroductionYou've got a queue. And you just got to mess with it.Given a queue of items and a series of queue operations, return the resulting queue. Queue operations are defined as follows:star原创 2012-08-08 19:41:38 · 386 阅读 · 0 评论 -
zoj2201
= =!这题。。。#include using namespace std;int main(){ int n,x,y; cin>>n; while(n--) { cin>>x>>y; if(x>=y) cout<<"MMM BRAINS"<<endl; else cout<<"NO BRAINS"<<endl; } retu原创 2012-08-08 14:45:39 · 325 阅读 · 0 评论 -
zoj2970----------------Faster, Higher, Stronger
In the year 2008, the 29th Olympic Games will be held in Beijing. This will signify the prosperity of China and Beijing Olympics is to be a festival for people all over the world as well.The motto o原创 2012-08-09 19:11:59 · 1123 阅读 · 0 评论 -
zoj1622----------------------------Switch
There are N lights in a line. Given the states (on/off) of the lights, your task is to determine at least how many lights should be switched (from on to off, or from off to on), in order to make the l原创 2012-08-03 10:15:45 · 588 阅读 · 0 评论 -
zoj1514--------------------------Fake Tickets
Your school organized a big party to celebrate your team brilliant win in the prestigious, worldfamous ICPC (International Collegiate Poetry Contest). Everyone in your school was invited for an evenin原创 2012-08-02 18:32:01 · 579 阅读 · 0 评论 -
zoj1383---------------------Binary Numbers
Given a positive integer n, print out the positions of all 1's in its binary representation. The position of the least significant bit is 0.ExampleThe positions of 1's in the binary representa原创 2012-08-02 18:15:03 · 438 阅读 · 0 评论 -
zoj3168------------------------Sort ZOJ7
Given a string of no more than 1000 characters. You are supposed to sort the characters into a substring of allZ's followed by O's, J's, 7's, and the rest of the other characters.InputEach cas原创 2012-08-02 23:35:16 · 790 阅读 · 0 评论 -
zoj1331----------------Perfect Cubes
For hundreds of years Fermat's Last Theorem, which stated simply that for n > 2 there exist no integers a, b, c > 1 such that a^n = b^n + c^n, has remained elusively unproven. (A recent proof is belie原创 2012-08-02 09:37:50 · 1377 阅读 · 0 评论 -
zoj1494
An inch worm is at the bottom of a well n inches deep. It has enough energy to climb u inches every minute, but then has to rest a minute before climbing again. During the rest, it slips down d inches原创 2012-06-06 22:45:43 · 335 阅读 · 0 评论 -
zoj1760 Doubles
As part of an arithmetic competency program, your students will be given randomly generated lists of from 2 to 15 unique positive integers and asked to determine how many items in each list are twice原创 2012-06-06 22:55:54 · 527 阅读 · 0 评论 -
zoj1402-------------Magnificent Meatballs
Sam and Ella run a catering service. They like to put on a show when serving meatballs to guests seated at round tables. They march out of the kitchen with pots of meatballs and start serving adjacent原创 2012-08-03 20:44:11 · 432 阅读 · 0 评论 -
zoj1715---------------------When Can We Meet?
The ICPC committee would like to have its meeting as soon as possible to address every little issue of the next contest. However, members of the committee are so busy maniacally developing (possibly u原创 2012-08-04 15:50:52 · 469 阅读 · 0 评论 -
zoj2417-------------Lowest Bit
Given an positive integer A (1 For example, given A = 26, we can write A in binary form as 11010, so the lowest bit of A is 10, so the output should be 2.Another example goes like this: given A =原创 2012-08-09 16:00:22 · 314 阅读 · 0 评论 -
zoj2781------------------------Rounders
IntroductionFor a given number, if greater than ten, round it to the nearest ten, then (if that result is greater than 100) take the result and round it to the nearest hundred, then (if that result原创 2012-08-08 18:39:17 · 458 阅读 · 0 评论 -
zoj2208--------------------To and Fro
Mo and Larry have devised a way of encrypting messages. They first decide secretly on the number of columns and write the message (letters only) down the columns, padding with extra random letters s原创 2012-08-08 16:37:06 · 388 阅读 · 0 评论 -
zoj1889------------------------------Ones
Given any integer 0 <= n <= 10000 not divisible by 2 or 5, some multiple of n is a number which in decimal notation is a sequence of 1's. How many digits are in the smallest such a multiple of n?原创 2012-08-07 15:31:35 · 442 阅读 · 0 评论 -
zoj1796-----------------Euchre Results
Anna, Betty, Cindy and Zelda like playing the card game Euchre. Euchre is a game for two teams of two, and each time they meet the girls split off into different teams. They also keep overall records原创 2012-08-07 14:42:37 · 491 阅读 · 0 评论 -
zoj1763-----------A Simple Question of Chemistry
Your chemistry lab instructor is a very enthusiastic graduate student who clearly has forgotten what their undergraduate Chemistry 101 lab experience was like. Your instructor has come up with the bri原创 2012-08-07 11:13:40 · 446 阅读 · 0 评论 -
zoj1730-----------------Crazy Tea Party
n participants of "crazy tea party" sit around the table. Each minute one pair of neighbors can change their places. Find the minimum time (in minutes) required for all participants to sit in reverse原创 2012-08-04 16:37:40 · 568 阅读 · 0 评论 -
zoj1712 Skew Binary
When a number is expressed in decimal, the kth digit represents a multiple of 10 k. (Digits are numbered from right to left, where the least significant digit is number 0.) For example,81307(10) =原创 2012-06-06 22:55:19 · 743 阅读 · 0 评论