Created
June 9, 2015 17:46
-
-
Save johnboker/bbc430218d9ce1ca18a1 to your computer and use it in GitHub Desktop.
This file contains 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 characters
using System; | |
using System.Collections; | |
using System.Globalization; | |
namespace acm.timus.ru_p1026 | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
ArrayList list = new ArrayList(100000); | |
NumberFormatInfo nfi = NumberFormatInfo.InvariantInfo; | |
string[] input = Console.In.ReadToEnd().Split(new char[] { ' ', '\t', '\n', '\r' }, StringSplitOptions.RemoveEmptyEntries); | |
int i = 0; | |
int len1 = Int32.Parse(input[0]); | |
for (i = 1; i <= len1; i++) | |
{ | |
int n = Int32.Parse(input[i]); | |
list.Add(n); | |
} | |
int len2 = Int32.Parse(input[len1+2]) + len1 + 3; | |
list.Sort(); | |
for (int j = len1 + 3; j < len2; j++) | |
{ | |
int n = Int32.Parse(input[j])-1; | |
Console.WriteLine(list[n]); | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment