結果

問題 No.2561 みんな大好きmod 998
ユーザー oharuoharu
提出日時 2023-12-03 16:23:27
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 513 bytes
コンパイル時間 1,841 ms
コンパイル使用メモリ 166,492 KB
実行使用メモリ 6,676 KB
最終ジャッジ日時 2023-12-03 16:23:32
合計ジャッジ時間 4,560 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,676 KB
testcase_01 AC 8 ms
6,676 KB
testcase_02 AC 2 ms
6,676 KB
testcase_03 AC 117 ms
6,676 KB
testcase_04 AC 110 ms
6,676 KB
testcase_05 AC 110 ms
6,676 KB
testcase_06 AC 110 ms
6,676 KB
testcase_07 AC 2 ms
6,676 KB
testcase_08 AC 2 ms
6,676 KB
testcase_09 AC 2 ms
6,676 KB
testcase_10 AC 2 ms
6,676 KB
testcase_11 AC 18 ms
6,676 KB
testcase_12 AC 1 ms
6,676 KB
testcase_13 AC 2 ms
6,676 KB
testcase_14 AC 1 ms
6,676 KB
testcase_15 WA -
testcase_16 AC 2 ms
6,676 KB
testcase_17 AC 2 ms
6,676 KB
testcase_18 AC 2 ms
6,676 KB
testcase_19 WA -
testcase_20 AC 2 ms
6,676 KB
testcase_21 AC 2 ms
6,676 KB
testcase_22 AC 2 ms
6,676 KB
testcase_23 AC 2 ms
6,676 KB
testcase_24 AC 2 ms
6,676 KB
testcase_25 AC 2 ms
6,676 KB
testcase_26 AC 23 ms
6,676 KB
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 WA -
testcase_37 WA -
testcase_38 WA -
testcase_39 AC 31 ms
6,676 KB
testcase_40 AC 31 ms
6,676 KB
testcase_41 WA -
testcase_42 WA -
testcase_43 WA -
testcase_44 WA -
testcase_45 AC 81 ms
6,676 KB
testcase_46 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)

long long A[28],B[28];
 
int n,k,p1=998,p2=998244352,t;


void f(int i,int l,long long ans,long long ans1){
    if(l==k){if(ans>=ans1){t++;t%=p1;}}
    else{
        for(int j=i+1;j<n;j++){
            f(j,l+1, (ans+A[j])%p1 , (ans+B[j])%p2 );
        }
    }
}

int main(){cin>>n>>k;
    rep(i,n){cin>>A[i];B[i]=A[i]%p2;A[i]%=p1;}
    for(int i=0;i<=n-k;i++){
        f(i,1,A[i],B[i]);
    }
    cout<<t<<endl;
}
0