Skip to content

Instantly share code, notes, and snippets.

@johnboker johnboker/p1026.cs
Created Jun 9, 2015

Embed
What would you like to do?
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
You can’t perform that action at this time.