結果
| 問題 | No.3662 yuu Hates Sigma Problem |
| コンテスト | |
| ユーザー |
aqua
|
| 提出日時 | 2026-08-30 16:04:38 |
| 言語 | C++23 (gcc 15.3.0 + boost 1.92.0) |
| 結果 |
AC
|
| 実行時間 | 30 ms / 2,000 ms |
| + 581µs | |
| コード長 | 788 bytes |
| 記録 | |
| コンパイル時間 | 2,201 ms |
| コンパイル使用メモリ | 334,776 KB |
| 実行使用メモリ | 6,272 KB |
| 最終ジャッジ日時 | 2026-08-30 16:04:44 |
| 合計ジャッジ時間 | 5,462 ms |
|
ジャッジサーバーID (参考情報) |
judge1_1 / judge3_0 |
(要ログイン)
| サブタスク | 配点 | 結果 |
|---|---|---|
| subtask1. | 20 % | AC * 19 |
| subtask2. | 30 % | AC * 13 |
| subtask3. | 50 % | AC * 49 |
| 合計 | 2.5 * 100% = 250 点 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
bool chmax(auto &a, auto b) { return a < b ? a = b, 1 : 0; }
bool chmin(auto &a, auto b) { return a > b ? a = b, 1 : 0; }
#include <atcoder/modint>
using mint = atcoder::modint998244353;
int main() {
cin.tie(nullptr);
ios::sync_with_stdio(false);
ll N; cin >> N;
vector<ll> A(N);
for (auto &&a : A) cin >> a;
int M = 20;
vector<ll> stand(M);
for (int i = 0; i < N; ++i) for (int j = 0; j < M; ++j) stand[j] += i >> j & 1;
mint ans = 0;
for (int i = 0; i < N; ++i) {
for (int j = 0; j < M; ++j) {
if (i >> j & 1) ans += A[i] * (N - stand[j]) * (1 << j);
else ans += A[i] * stand[j] * (1 << j);
}
}
cout << ans.val() << '\n';
}
aqua