Last active
June 1, 2021 02:12
-
-
Save sakapon/3de57bb2886ab2e84bae2cd3359b26a4 to your computer and use it in GitHub Desktop.
競プロ典型 90 問 / Q027
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.Generic; | |
class Q027 | |
{ | |
static void Main() | |
{ | |
var n = int.Parse(Console.ReadLine()); | |
var set = new HashSet<string>(); | |
for (int i = 1; i <= n; i++) | |
{ | |
var s = Console.ReadLine(); | |
if (set.Add(s)) Console.WriteLine(i); | |
} | |
} | |
} |
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.Linq; | |
class Q027 | |
{ | |
static void Main() => Console.WriteLine(string.Join("\n", Enumerable.Range(1, int.Parse(Console.ReadLine())).GroupBy(_ => Console.ReadLine()).Select(g => g.First()))); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://atcoder.jp/contests/typical90/submissions/23091428
https://atcoder.jp/contests/typical90/submissions/22511273