National Informatics OlympiadNational RoundRazgrad, 26 to 28 April, 20 dịch - National Informatics OlympiadNational RoundRazgrad, 26 to 28 April, 20 Việt làm thế nào để nói

National Informatics OlympiadNation

National Informatics Olympiad
National Round
Razgrad, 26 to 28 April, 2013
Group D, 6th grade
Task D3. RABBITS
In a living laboratory N rabbits that are numbered from 1 to N.
In the laboratory, there is a row of N cells, arranged in a row and numbered from
1 to N. For an array of cells has a number of feeders, which are also
numbered from 1 to N, but disordered, ie in some order h1, h2, ... ..hN.
Rabbits are located in cells disordered, as in Box 1 is rabbit m1, in
Box 2 - rabbit m2, etc. and eat according to the principle "rabbit with number k eat
Feed number k ", by simply moving it. If the rabbit number k is
in cell number p, and the link with the number k is against cell number q, it rabbit with number k
must travel a distance | pq | to the feeder in order to eat there by
carrot.
rabbits
feeders
With such an arrangement of racks rabbit number 1 will travels
3 distance before eating rabbit 2 - a distance of 2, 3 rabbit - a distance of 4, rabbit 4
It will not move, and rabbit 5 will have to walk a distance of 1.
Write a program rabbits, which receives the location of rabbits and
feeders and determines the longest distance that a rabbit will need
to travel to reach your carrot.
Input
The first line of standard input, one integer
N- including number of rabbits.
From the second line introduces the numbers from 1 to N, mixed in some way -
numbers of rabbits living in the first, second, etc. cells.
Third row introducing numbers from 1 to N, mixed in some way -
numbers of racks located on the first, second, etc. cells.
Exit
The standard output should put an integer -
the maximum distance you have to go rabbit cage to the feeder
in order to feed.
Limitations
2 ≤ N ≤ 100 000, in 50% of tests 2 ≤ N ≤ 1000
Example (refer to the figure above)
Input Output
5
2 1 5 4 3
3 5 2 4 1
4
2 1 5 4 3
3 5 2 4 1
0/5000
Từ: -
Sang: -
Kết quả (Việt) 1: [Sao chép]
Sao chép!
National Informatics OlympiadNational RoundRazgrad, 26 to 28 April, 2013Group D, 6th gradeTask D3. RABBITSIn a living laboratory N rabbits that are numbered from 1 to N.In the laboratory, there is a row of N cells, arranged in a row and numbered from1 to N. For an array of cells has a number of feeders, which are alsonumbered from 1 to N, but disordered, ie in some order h1, h2, ... ..hN.Rabbits are located in cells disordered, as in Box 1 is rabbit m1, inBox 2 - rabbit m2, etc. and eat according to the principle "rabbit with number k eatFeed number k ", by simply moving it. If the rabbit number k isin cell number p, and the link with the number k is against cell number q, it rabbit with number kmust travel a distance | pq | to the feeder in order to eat there bycarrot.rabbitsfeedersWith such an arrangement of racks rabbit number 1 will travels3 distance before eating rabbit 2 - a distance of 2, 3 rabbit - a distance of 4, rabbit 4It will not move, and rabbit 5 will have to walk a distance of 1.Write a program rabbits, which receives the location of rabbits andfeeders and determines the longest distance that a rabbit will needto travel to reach your carrot.InputThe first line of standard input, one integerN- including number of rabbits.From the second line introduces the numbers from 1 to N, mixed in some way -numbers of rabbits living in the first, second, etc. cells.Third row introducing numbers from 1 to N, mixed in some way -numbers of racks located on the first, second, etc. cells.ExitThe standard output should put an integer -the maximum distance you have to go rabbit cage to the feederin order to feed.Limitations2 ≤ N ≤ 100 000, in 50% of tests 2 ≤ N ≤ 1000Example (refer to the figure above)Input Output52 1 5 4 33 5 2 4 142 1 5 4 33 5 2 4 1
đang được dịch, vui lòng đợi..
Kết quả (Việt) 2:[Sao chép]
Sao chép!
Quốc gia Tin học Olympiad
Round Quốc
Razgrad, 26-ngày 28 tháng 4, năm 2013
Nhóm D, lớp 6
Nhiệm vụ D3. Thỏ
Trong một phòng thí nghiệm sống N thỏ được đánh số từ 1 đến N.
Trong phòng thí nghiệm, có một hàng tế bào N, sắp xếp trong một hàng và được đánh số từ
1 đến N. Đối với một mảng của các tế bào có một số máng ăn, mà cũng
được. đánh số từ 1 đến N, nhưng bị rối loạn, tức là trong một số h1 trật tự, h2, ... ..hN
Thỏ đang nằm trong các tế bào bị rối loạn, như trong Hộp 1 là thỏ m1, trong
Box 2 - thỏ m2, vv và ăn theo các nguyên tắc "thỏ với số k ăn
thức ăn số k", bởi đơn giản là di chuyển nó. Nếu số lượng thỏ k là
số lượng tế bào p, và liên kết với số k là chống lại số di động q, nó thỏ với số k
phải đi một khoảng cách | pq | đến feeder để ăn ở đó bởi
cà rốt.
Thỏ
ăn
Với như một sự sắp xếp kệ thỏ số 1 sẽ đi
3 khoảng cách trước khi ăn thỏ 2 - một khoảng cách 2, 3 thỏ - một khoảng cách 4, thỏ 4
Nó sẽ không di chuyển, và thỏ 5 sẽ phải đi bộ một khoảng cách 1.
Viết một con thỏ chương trình, mà nhận được vị trí của thỏ và
ăn và xác định khoảng cách dài nhất mà một con thỏ sẽ cần
để đi du lịch để đạt được cà rốt. bạn
Input
Dòng đầu tiên của đầu vào tiêu chuẩn, một số nguyên
N bao gồm cả số thỏ.
​​Từ dòng thứ hai giới thiệu các số từ 1 đến N, trộn lẫn một cách nào đó -
số lượng thỏ sống trong lần đầu tiên, thứ hai, vv tế bào.
hàng giới thiệu số thứ ba từ 1 đến N, trộn lẫn một cách nào đó -
số kệ nằm trên đầu, thứ hai ., vv tế bào
Thoát
Các chuẩn đầu ra nên đặt một số nguyên -
khoảng cách tối đa mà bạn phải đi thỏ lồng đến feeder
để ăn.
Hạn chế
2 ≤ N ≤ 100 000, trong 50% các bài kiểm tra 2 ≤ N ≤ 1000
Ví dụ (tham khảo hình trên)
Input Output
5
2 1 5 4 3
3 5 2 4 1
4
2 1 5 4 3
3 5 2 4 1
đang được dịch, vui lòng đợi..
 
Các ngôn ngữ khác
Hỗ trợ công cụ dịch thuật: Albania, Amharic, Anh, Armenia, Azerbaijan, Ba Lan, Ba Tư, Bantu, Basque, Belarus, Bengal, Bosnia, Bulgaria, Bồ Đào Nha, Catalan, Cebuano, Chichewa, Corsi, Creole (Haiti), Croatia, Do Thái, Estonia, Filipino, Frisia, Gael Scotland, Galicia, George, Gujarat, Hausa, Hawaii, Hindi, Hmong, Hungary, Hy Lạp, Hà Lan, Hà Lan (Nam Phi), Hàn, Iceland, Igbo, Ireland, Java, Kannada, Kazakh, Khmer, Kinyarwanda, Klingon, Kurd, Kyrgyz, Latinh, Latvia, Litva, Luxembourg, Lào, Macedonia, Malagasy, Malayalam, Malta, Maori, Marathi, Myanmar, Mã Lai, Mông Cổ, Na Uy, Nepal, Nga, Nhật, Odia (Oriya), Pashto, Pháp, Phát hiện ngôn ngữ, Phần Lan, Punjab, Quốc tế ngữ, Rumani, Samoa, Serbia, Sesotho, Shona, Sindhi, Sinhala, Slovak, Slovenia, Somali, Sunda, Swahili, Séc, Tajik, Tamil, Tatar, Telugu, Thái, Thổ Nhĩ Kỳ, Thụy Điển, Tiếng Indonesia, Tiếng Ý, Trung, Trung (Phồn thể), Turkmen, Tây Ban Nha, Ukraina, Urdu, Uyghur, Uzbek, Việt, Xứ Wales, Yiddish, Yoruba, Zulu, Đan Mạch, Đức, Ả Rập, dịch ngôn ngữ.

Copyright ©2024 I Love Translation. All reserved.

E-mail: