結果
問題 |
No.1362 [Zelkova 8th Tune] Black Sheep
|
ユーザー |
![]() |
提出日時 | 2021-01-23 07:19:42 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
AC
|
実行時間 | 74 ms / 1,000 ms |
コード長 | 603 bytes |
コンパイル時間 | 3,525 ms |
コンパイル使用メモリ | 109,080 KB |
実行使用メモリ | 19,328 KB |
最終ジャッジ日時 | 2024-12-29 22:42:25 |
合計ジャッジ時間 | 5,054 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 38 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using System.Collections.Generic; using System; public class Hello { static void Main() { var s = Console.ReadLine().Trim(); getAns(s); } static void getAns(string s) { var d = new Dictionary<char, int>(); for (int i = 0; i < s.Length; i++) { if (d.ContainsKey(s[i])) d[s[i]]++; else d[s[i]] = 1; } foreach(var x in d) { if (x.Value == 1) { Console.WriteLine("{0} {1}",s.IndexOf(x.Key) + 1,x.Key); return; } } } }