Skip to content

Instantly share code, notes, and snippets.

@johnboker
Created June 9, 2015 17:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save johnboker/bbc430218d9ce1ca18a1 to your computer and use it in GitHub Desktop.
Save johnboker/bbc430218d9ce1ca18a1 to your computer and use it in GitHub Desktop.
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