結果

問題 No.2537 多重含意
ユーザー maksimmaksim
提出日時 2023-11-10 22:59:52
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 585 bytes
コンパイル時間 3,432 ms
コンパイル使用メモリ 172,964 KB
実行使用メモリ 7,296 KB
最終ジャッジ日時 2023-11-10 22:59:57
合計ジャッジ時間 3,932 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,676 KB
testcase_01 AC 2 ms
6,676 KB
testcase_02 AC 2 ms
6,676 KB
testcase_03 AC 2 ms
6,676 KB
testcase_04 AC 2 ms
6,676 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 2 ms
6,676 KB
testcase_09 AC 2 ms
6,676 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;
#define int long long
int32_t main()
{
    ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
    int n,p;cin>>n>>p;int a[n];for(int i=0;i<n;++i) cin>>a[i];
    int po[n+1]={1};for(int i=0;i<n;++i) {po[i+1]=(2*po[i])%p;}
    set<int> h;int answ=0;
    for(int i=0;i<n;++i)
    {
        if(h.count(a[i])) {}
        else if(i%2==1) {}
        else {answ+=po[n-h.size()-1];answ%=p;}
        h.insert(a[i]);
        int answ2=answ;
        if(i%2==1) {answ2+=po[n-h.size()];answ2%=p;}
        cout<<answ2<<endl;
    }
    return 0;
}
0