結果
問題 |
No.1904 Never giving up!
|
ユーザー |
|
提出日時 | 2022-06-23 21:08:27 |
言語 | C# (.NET 8.0.404) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,150 bytes |
コンパイル時間 | 17,501 ms |
コンパイル使用メモリ | 167,664 KB |
実行使用メモリ | 185,408 KB |
最終ジャッジ日時 | 2024-11-07 14:29:50 |
合計ジャッジ時間 | 18,714 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 7 WA * 2 |
コンパイルメッセージ
復元対象のプロジェクトを決定しています... /home/judge/data/code/main.csproj を復元しました (108 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; using System.Collections; using System.Collections.Generic; using System.Linq; using System.Numerics; using System.Text; //using static CompLib.CompLib; //using DataStructure; namespace atcoder { class Program { const int intMax = 1000000000; const long longMax = 2000000000000000000; static void Main(string[] args) { int N = int.Parse(Console.ReadLine()); var A = Console.ReadLine().Split().Select(int.Parse).ToArray(); long all = 0; for (int i = 1; i <= N; i++) { if (i == 1) all = i; else all *= i; } var list = new int[N + 1]; for (int i = 0; i < N; i++) { list[A[i]]++; } long p = 1; for (int i = 0; i < N; i++) { if (list[i] > 0) { for (int j = 1; j <= list[i]; j++) { p *= j; } } } Console.WriteLine(all / p); } } }