Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- namespace Задачи_CodeForces
- {
- class Program
- {
- static void Main(string[] args)
- {
- Dictionary<string, int> archive = new Dictionary<string, int>();
- int linesCount = int.Parse(Console.ReadLine());
- for (int i = 0; i < linesCount; i++)
- {
- string temp = Console.ReadLine();
- if (archive.ContainsKey(temp))
- {
- string newName = temp + archive[temp]++;
- archive.Add(newName, 1);
- Console.WriteLine(newName);
- }
- else
- {
- archive.Add(temp, 1);
- Console.WriteLine("OK");
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement