Solutions are presented as using the least memory and the fastest execution time. It also takes the top
10 most recent solutions from each language. If you want to limit to a specific index, click the
"Solved" button and go to that problem.
ContestId |
Name |
Phase |
Frozen |
Duration (Seconds) |
Relative Time |
Start Time |
13
|
Codeforces Beta Round 13 |
FINISHED |
False |
7200 |
458668799 |
May 6, 2010, 2 p.m. |
Problems
B"Little Petya likes to play a lot. Most of all he likes to play a game xc2 xabHoles xc2 xbb. This is a game for one person with following rules: There are N holes located in a single row and numbered from left to right with numbers from 1 to N. Each hole has it's own power (hole number i has the power ai). If you throw a ball into hole i it will immediately jump to hole i xe2 x80 x89+ xe2 x80 x89ai, then it will jump out of it and so on. If there is no hole with such number, the ball will just jump out of the row. On each of the M moves the player can perform one of two actions: Petya is not good at math, so, as you have already guessed, you are to perform all computations. The first line contains two integers N and M (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89N xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89105, 1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89M xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89105) -- the number of holes in a row and the number of moves. The second line contains N positive integers not exceeding N -- initial values of holes power. The following M lines describe moves made by Petya. Each of these line can be one of the two types: For each move of the type 1 output two space-separated numbers on a separate line -- the number of the last hole the ball visited before leaving the row and the number of jumps it made."... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
58277 |
Burunduk1 |
E |
May 6, 2010, 3:49 p.m. |
OK |
GNU C++ |
TESTS |
52 |
380 |
2560000 |
|
2700 |
58263 |
ivan.metelsky |
E |
May 6, 2010, 3:49 p.m. |
OK |
Java 6 |
TESTS |
52 |
880 |
33894400 |
|
2700 |
57864 |
dzhulgakov |
E |
May 6, 2010, 3:33 p.m. |
OK |
MS C++ |
TESTS |
52 |
610 |
2764800 |
|
2700 |
remove filters
Back to search problems