結果
問題 | No.2590 100000 Days of Christmas |
ユーザー |
![]() |
提出日時 | 2024-04-11 15:04:00 |
言語 | C# (.NET 8.0.404) |
結果 |
WA
|
実行時間 | - |
コード長 | 755 bytes |
コンパイル時間 | 9,697 ms |
コンパイル使用メモリ | 167,892 KB |
実行使用メモリ | 219,192 KB |
最終ジャッジ日時 | 2024-10-02 21:36:44 |
合計ジャッジ時間 | 14,046 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 15 WA * 7 |
コンパイルメッセージ
復元対象のプロジェクトを決定しています... /home/judge/data/code/main.csproj を復元しました (89 ms)。 MSBuild のバージョン 17.9.6+a4ecab324 (.NET) main -> /home/judge/data/code/bin/Release/net8.0/main.dll main -> /home/judge/data/code/bin/Release/net8.0/publish/
ソースコード
using System.Text;using System.Linq;using System.Collections.Generic;using System;public class Hello{static void Main(){var n = int.Parse(Console.ReadLine().Trim());getAns(n);}static void getAns(int n){var d = new Dictionary<string, long>();for (int i = 0; i < n; i++){var s = Console.ReadLine().Trim();if (d.ContainsKey(s)) d[s] += (long)(i + 1) * (n - i);else d[s] = (long)(i + 1) * (n - i);}var Lex = d.Keys.ToArray();Array.Sort(Lex, string.CompareOrdinal);var sb = new StringBuilder();foreach (var x in Lex) sb.Append(string.Format("{0} {1}\n", d[x], x));Console.Write(sb);}}