結果
| 問題 | No.3431 popcount & sum (Easy) |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-01-11 14:41:33 |
| 言語 | C++23 (gcc 15.2.0 + boost 1.90.0) |
| 結果 |
AC
|
| 実行時間 | 13 ms / 2,000 ms |
| + 786µs | |
| コード長 | 437 bytes |
| 記録 | |
| コンパイル時間 | 1,950 ms |
| コンパイル使用メモリ | 335,184 KB |
| 実行使用メモリ | 5,888 KB |
| 最終ジャッジ日時 | 2026-07-20 06:21:18 |
| 合計ジャッジ時間 | 3,128 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 9 |
ソースコード
#include <bits/stdc++.h>
#include <atcoder/modint>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using mint = atcoder::modint998244353;
int main(){
int n;
cin >> n;
mint ans=0;
rep(i,n+1)
rep(j,n+1){
if(j<i)continue;
if(__builtin_popcount(i) != __builtin_popcount(j))continue;
ans+=(i&j);
}
cout << ans.val() << endl;
return 0;
}