結果
| 問題 | No.3662 yuu Hates Sigma Problem |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-08-30 15:16:55 |
| 言語 | Python3 (3.14.7 + numpy 2.5.2 + scipy 1.18.0) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 1,116 bytes |
| 記録 | |
| コンパイル時間 | 309 ms |
| コンパイル使用メモリ | 21,416 KB |
| 実行使用メモリ | 33,904 KB |
| 最終ジャッジ日時 | 2026-08-30 15:17:57 |
| 合計ジャッジ時間 | 18,725 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_0 |
(要ログイン)
| サブタスク | 配点 | 結果 |
|---|---|---|
| subtask1. | 20 % | AC * 19 |
| subtask2. | 30 % | AC * 13 |
| subtask3. | 50 % | AC * 31 RE * 18 |
| 合計 | 2.5 * 50% = 125 点 |
ソースコード
import sys
import math
#from collections import deque, defaultdict, Counter
#import heapq
#import bisect
#import itertools
#import functools
# 外部ライブラリ(AtCoder環境で利用可能)
#from sortedcontainers import SortedList, SortedSet, SortedDict
#from atcoder.dsu import DSU
#from atcoder.segtree import SegTree
#from atcoder.lazysegtree import LazySegTree
#from atcoder.fenwicktree import FenwickTree
# 入力高速化
#input = sys.stdin.readline
# 再帰回数上限
# よくあるmod
#MOD = 1000000007
MOD = 998244353
def solve():
# 解答ここから
N = int(input())
powers = set()
cur = 1
while cur <= N:
cur *= 2
powers.add(cur)
A = list(map(int, input().split(' ')))
if N <= 3000:
ans = 0
for i in range(N):
for j in range(N):
ans = (ans + A[i] * (i^j)) % MOD
elif N in powers:
ans = 0
for i in range(N):
ans = (ans + A[i] * (N // 2) * (N-1)) % MOD
else:
print(0)
print(ans)
if __name__ == '__main__':
T = 1
for _ in range(T):
solve()