結果
問題 | No.1554 array_and_me |
ユーザー | kotatsugame |
提出日時 | 2021-06-18 22:22:51 |
言語 | C++14 (gcc 12.3.0 + boost 1.83.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 715 bytes |
コンパイル時間 | 901 ms |
コンパイル使用メモリ | 80,036 KB |
実行使用メモリ | 5,692 KB |
最終ジャッジ日時 | 2023-09-04 23:32:55 |
合計ジャッジ時間 | 4,284 ms |
ジャッジサーバーID (参考情報) |
judge14 / judge12 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 3 ms
4,380 KB |
testcase_01 | AC | 20 ms
4,380 KB |
testcase_02 | AC | 20 ms
4,380 KB |
testcase_03 | AC | 20 ms
4,380 KB |
testcase_04 | AC | 20 ms
4,384 KB |
testcase_05 | AC | 20 ms
4,380 KB |
testcase_06 | WA | - |
testcase_07 | WA | - |
testcase_08 | WA | - |
testcase_09 | WA | - |
testcase_10 | WA | - |
testcase_11 | AC | 27 ms
5,492 KB |
testcase_12 | AC | 26 ms
5,348 KB |
testcase_13 | AC | 26 ms
5,364 KB |
testcase_14 | AC | 26 ms
5,312 KB |
testcase_15 | AC | 26 ms
5,408 KB |
testcase_16 | WA | - |
testcase_17 | WA | - |
testcase_18 | WA | - |
testcase_19 | WA | - |
testcase_20 | WA | - |
testcase_21 | WA | - |
testcase_22 | WA | - |
testcase_23 | WA | - |
testcase_24 | WA | - |
testcase_25 | WA | - |
testcase_26 | WA | - |
testcase_27 | WA | - |
testcase_28 | WA | - |
testcase_29 | WA | - |
testcase_30 | WA | - |
testcase_31 | WA | - |
testcase_32 | WA | - |
testcase_33 | WA | - |
testcase_34 | WA | - |
testcase_35 | WA | - |
testcase_36 | AC | 38 ms
4,380 KB |
testcase_37 | AC | 38 ms
4,384 KB |
testcase_38 | AC | 38 ms
4,380 KB |
testcase_39 | AC | 38 ms
4,384 KB |
testcase_40 | AC | 38 ms
4,380 KB |
testcase_41 | AC | 22 ms
4,380 KB |
コンパイルメッセージ
main.cpp:9:1: 警告: ISO C++ では型の無い ‘main’ の宣言を禁止しています [-Wreturn-type] 9 | main() | ^~~~
ソースコード
#include<iostream> #include<queue> #include<atcoder/modint> using namespace std; using mint=atcoder::modint998244353; int T,N,K; int A[1<<17]; mint inv[1<<17]; main() { cin>>T; inv[1]=1; for(int i=2;i<1<<17;i++)inv[i]=-(998244353/i)*inv[998244353%i]; for(;T--;) { cin>>N>>K; int sum=0; priority_queue<pair<int,pair<int,int> > >P; for(int i=0;i<N;i++) { cin>>A[i]; P.push(make_pair(A[i]*K,make_pair(A[i],0))); sum+=A[i]; } mint ans=1,invsum=mint(1)/sum; for(int i=1;i<=K;i++) { ans*=i; pair<int,pair<int,int> >p=P.top();P.pop(); p.first-=sum; p.second.second--; P.push(p); ans*=inv[-p.second.second]; ans*=p.second.first*invsum; } cout<<ans.val()<<endl; } }