結果
| 問題 |
No.1904 Never giving up!
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-04-15 21:34:49 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 341 bytes |
| コンパイル時間 | 2,014 ms |
| コンパイル使用メモリ | 194,172 KB |
| 最終ジャッジ日時 | 2025-01-28 17:58:24 |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 9 |
ソースコード
#include<bits/stdc++.h>
using namespace std;
long fct(int N){
long res=1;
while(N){
res*=N;
N--;
}
return res;
}
int main(){
int N;
cin>>N;
vector<long> cnt(N);
for(int i=0;i<N;++i){
int a;
cin>>a;
cnt[a-1]++;
}
long ans=fct(N);
for(int i=0;i<N;++i){
ans/=fct(cnt[i]);
}
cout<<ans<<endl;
}