Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.IO;
- namespace ConsoleApp1
- {
- class Program
- {
- static List<int> stringToInt(string[] tmp)
- {
- List<int> result = new List<int>();
- for (int i = 0; i < tmp.Length; i++)
- {
- if (tmp[i] != "-")
- {
- result.Add(int.Parse(tmp[i]));
- }
- }
- return result;
- }
- static void Main(string[] args)
- {
- string[] elsoSor = Console.ReadLine().Trim().Split(' ');
- int kutyaszam = Convert.ToInt32(elsoSor[0]);
- int maxpontok = Convert.ToInt32(elsoSor[1]);
- int minpontok = Convert.ToInt32(elsoSor[2]);
- string[] elsokutya = Console.ReadLine().Trim().Split(' ');
- for (int i = 0; i < kutyaszam; i++)
- {
- string[] beolvadsottertek = Console.ReadLine().Trim().Split(' ');
- for (int j = 0; j < elsokutya.Length; j++)
- {
- int y = 0;
- while (y < beolvadsottertek.Length && elsokutya[j] != beolvadsottertek[y])
- {
- y++;
- }
- if (y == beolvadsottertek.Length)
- {
- elsokutya[j] = "-";
- }
- }
- }
- List<int> vegleges = stringToInt(elsokutya);
- vegleges.Sort();
- int Db = vegleges.Count;
- string eredmeny = "";
- for (int j = 0; j < vegleges.Count; j++)
- {
- if (j > 0)
- {
- eredmeny += " ";
- }
- eredmeny += vegleges[j];
- }
- Console.WriteLine("{0} {1}", Db, eredmeny);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement