結果
| 問題 | No.2711 Connecting Lights |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-08-25 04:50:57 |
| 言語 | C++23(gcc16) (gcc 16.1.0 + boost 1.92.0) |
| 結果 |
AC
|
| 実行時間 | 69 ms / 5,000 ms |
| + 345µs | |
| コード長 | 507 bytes |
| 記録 | |
| コンパイル時間 | 1,994 ms |
| コンパイル使用メモリ | 176,064 KB |
| 実行使用メモリ | 6,272 KB |
| 最終ジャッジ日時 | 2026-08-25 04:51:02 |
| 合計ジャッジ時間 | 4,242 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 27 |
ソースコード
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
using ll = long long;
int main(void){
int n, m, k; cin >> n >> m >> k;
int mx=(1<<n);
ll mod=998244353;
vector<ll> dp(mx, 1);
for(int i=0; i<m-1; i++){
vector<ll> old(mx);
swap(old, dp);
for(int p=0; p<mx; p++)for(int q=0; q<mx; q++){
int x=__builtin_popcount(p&q);
if(x>=k) dp[q]+=old[p], dp[q]%=mod;
}
}
ll ans=0;
for(auto&x:dp) ans+=x, ans%=mod;
cout << ans << endl;
return 0;
}