Created
October 2, 2020 13:40
-
-
Save page2me/3bb36597f7e1c9b01168fcb73fd9c58d to your computer and use it in GitHub Desktop.
Revisions
-
hekar revised this gist
Aug 10, 2016 . 1 changed file with 3 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -7,8 +7,10 @@ def main(): (n, k, q) = line_int() arr = line_int() r = k%n for j in range(q): m = int(input()) i = (m - r) print (arr[i if i >= 0 else i + n]) main() -
hekar renamed this gist
Aug 10, 2016 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
hekar created this gist
Aug 10, 2016 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,14 @@ #!/usr/bin/env python def line_int(): return [int(x) for x in input().split(' ')] def main(): (n, k, q) = line_int() arr = line_int() for j in range(q): m = int(input()) print (arr[(m + k) % n]) main()