結果
問題 | No.2537 多重含意 |
ユーザー |
![]() |
提出日時 | 2023-11-10 22:01:45 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 168 ms / 2,000 ms |
コード長 | 555 bytes |
コンパイル時間 | 3,177 ms |
コンパイル使用メモリ | 247,784 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-09-26 01:32:37 |
合計ジャッジ時間 | 4,666 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 24 |
ソースコード
#include<bits/stdc++.h> using namespace std; using ll = long long; #include<atcoder/modint> using mint = atcoder::modint; int main(){ int n,b; cin>>n>>b; mint::set_mod(b); int cnt = 0; vector<int> now(n,0); vector<int> a(n); for(int i = 0;i<n;i++) cin>>a[i]; bool ok = true; int all = 0; for(int i = 0;i<n;i++){ a[i]--; now[a[i]]++; mint ans = mint(2).pow(n); if(now[a[i]]==1) all++; if(now[a[i]]==1) ans -= mint(2).pow(n-all); cout<<ans.val()<<endl; } }