Unknown Language Round 3

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
100 Unknown Language Round 3 FINISHED False 10800 464400023 July 30, 2011, 6 a.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 305 ) E Lamps in a Line PROGRAMMING *special math 1800

There are n lamps in a line. The lamps are numbered 1 to n from left to right. There are also n keys. When key number i is pressed, all lamps number x such that i | x change their state. For two integer numbers a and b , we say a | b if and only if there exists an integer c such that a × c = b . Amirali likes to play with the keys. He randomly pressed k keys and wants to know the final state of the lamps. Help him by writing a Pike piece of code to solve this task. The first line of input contains a single integer n , the number of lamps ( 1 ≤ n ≤ 10 5 ). The following line contains n words. The i -th word describes the initial state of lamp number i (see samples for details). The following line contains a single integer k ( 1 ≤ k ≤ 10 4 ), the number of times a key is pressed. Then in the next line come k integers in range 1, n which are the numbers of the pressed keys. Write n words to output. Describe the final state of the lamps. See samples for more details.

Tutorials

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
41009097 ReaLNero1 E July 31, 2018, 11:38 a.m. OK Pike TESTS 25 93 2662400 1800
14401579 vjudge5 E Nov. 21, 2015, 4:27 p.m. OK Pike TESTS 25 93 3174400 1800
34974101 Stronger2020 E Feb. 6, 2018, 2:44 p.m. OK Pike TESTS 25 108 9932800 1800
17832513 pegasas E May 10, 2016, 1:46 p.m. OK Pike TESTS 25 109 10444800 1800
21882685 onkrot E Oct. 29, 2016, 8:33 p.m. OK Pike TESTS 25 124 3174400 1800
573302 JoKe E July 30, 2011, 7:10 p.m. OK Pike TESTS 25 140 9420800 1800
573007 fura2 E July 30, 2011, 12:28 p.m. OK Pike TESTS 25 140 9523200 1800
572619 ike321 E July 30, 2011, 8:57 a.m. OK Pike TESTS 25 140 9523200 1800
1175151 Archon.JK E Feb. 13, 2012, 6:51 a.m. OK Pike TESTS 25 140 9625600 1800
1175150 Archon.JK E Feb. 13, 2012, 6:49 a.m. OK Pike TESTS 25 140 9625600 1800

remove filters

Back to search problems