結果
| 問題 | No.2111 Sum of Diff |
| コンテスト | |
| ユーザー |
nonon
|
| 提出日時 | 2024-09-12 11:45:40 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.90.0) |
| 結果 |
AC
|
| 実行時間 | 49 ms / 2,000 ms |
| コード長 | 386 bytes |
| 記録 | |
| コンパイル時間 | 1,041 ms |
| コンパイル使用メモリ | 215,056 KB |
| 実行使用メモリ | 16,640 KB |
| 最終ジャッジ日時 | 2026-07-05 15:55:11 |
| 合計ジャッジ時間 | 4,181 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 20 |
ソースコード
#include<bits/stdc++.h>
#include<atcoder/modint>
using namespace std;
using mint=atcoder::modint998244353;
int main()
{
ios::sync_with_stdio(false);
cin.tie(nullptr);
int N;
cin>>N;
mint ans=0;
for(int i=0;i<N;i++)
{
int A;
cin>>A;
ans-=A*mint::raw(2).pow(i);
ans+=A*mint::raw(2).pow(N-1-i);
}
cout<<ans.val()<<endl;
}
nonon