結果

問題 No.2941 Sigma Music Game Score Problem
ユーザー kazuppakazuppa
提出日時 2024-09-16 10:05:15
言語 C++23(gcc13)
(gcc 13.2.0 + boost 1.83.0)
結果
RE  
(最新)
AC  
(最初)
実行時間 -
コード長 3,030 bytes
コンパイル時間 6,774 ms
コンパイル使用メモリ 338,032 KB
実行使用メモリ 17,024 KB
最終ジャッジ日時 2024-09-16 23:18:39
合計ジャッジ時間 11,088 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 6 ms
7,136 KB
testcase_01 AC 7 ms
7,168 KB
testcase_02 AC 6 ms
7,172 KB
testcase_03 AC 7 ms
7,168 KB
testcase_04 AC 5 ms
7,164 KB
testcase_05 AC 6 ms
7,296 KB
testcase_06 AC 6 ms
7,168 KB
testcase_07 AC 5 ms
7,168 KB
testcase_08 AC 6 ms
7,128 KB
testcase_09 AC 6 ms
7,224 KB
testcase_10 RE -
testcase_11 RE -
testcase_12 RE -
testcase_13 AC 7 ms
7,336 KB
testcase_14 AC 8 ms
7,296 KB
testcase_15 AC 7 ms
7,168 KB
testcase_16 RE -
testcase_17 RE -
testcase_18 RE -
testcase_19 RE -
testcase_20 RE -
testcase_21 RE -
testcase_22 RE -
testcase_23 RE -
testcase_24 RE -
testcase_25 RE -
testcase_26 RE -
testcase_27 RE -
testcase_28 AC 6 ms
7,200 KB
testcase_29 AC 54 ms
13,568 KB
testcase_30 AC 78 ms
17,024 KB
testcase_31 RE -
testcase_32 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#include <atcoder/all>
#pragma GCC target ("avx")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
using namespace std;
using namespace atcoder;
using ll=long long;
#define rep(i,a,b) for(it i=(it)(a);i<=(it)b;i++)
#define nrep(i,a,b) for(it i=(it)(a);i>=(it)b;i--)
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
#define moda 998244353LL
#define modb 1000000007LL
#define gyaku 166374059LL
#define dai 2500000000000000000LL
#define aoi 1e+18
#define tyu 2500000000
#define giri 1000000000
#define en 3.14159265358979
#define endl '\n'
#define sho -dai
#define eps 1e-14
#define yn(x) cout<<(x ? "Yes\n":"No\n");
#define YN(x) cout<<(x ? "YES\n":"NO\n");
#define cou(x) cout<<x<<endl;
#define ci(x) cin>>x;
using it=long long;
using un=unsigned long long;
using db=long double;
using st=string;
using ch=char;
using bo=bool;
using P=pair<it,it>;
using ip=pair<int,int>;
using mint=modint;
using mints=modint998244353;
using minto=modint1000000007;
using vi=vector<it>;
using ivi=vector<int>;
using vd=vector<db>;
using vs=vector<st>;
using vc=vector<ch>;
using vb=vector<bo>;
using vp=vector<P>;
using ivp=vector<ip>;
using vm=vector<mint>;
using vms=vector<mints>;
using vmo=vector<minto>;
using sp=set<P>;
using isp=set<ip>;
using ss=set<st>;
using sc=set<ch>;
using si=set<it>;
using isi=set<int>;
using svi=set<vi>;
using vvi=vector<vi>;
using ivvi=vector<ivi>;
using vvd=vector<vd>;
using vvs=vector<vs>;
using vvb=vector<vb>;
using vvc=vector<vc>;
using vvp=vector<vp>;
using ivvp=vector<ivp>;
using vvm=vector<vm>;
using vvms=vector<vms>;
using vvmo=vector<vmo>;
using vsi=vector<si>;
using ivsi=vector<isi>;
using vsp=vector<sp>;
using ivsp=vector<isp>;
using vvsi=vector<vsi>;
using ivvsi=vector<ivsi>;
using vvsp=vector<vsp>;
using ivvsp=vector<ivsp>;
using vvvi=vector<vvi>;
using ivvvi=vector<ivvi>;
using vvvd=vector<vvd>;
using vvvm=vector<vvm>;
using vvvvi=vector<vvvi>;
using ivvvvi=vector<ivvvi>;
const it dx[4]={0,1,0,-1};
const it dy[4]={1,0,-1,0};

template<typename T>
void scan(vector<T> &a){
  rep(i,0,a.size()-1)cin>>a[i];
}

template<typename T>
void scan(vector<T> &a,vector<T>&b){
  rep(i,0,a.size()-1)cin>>a[i]>>b[i];
}

template<typename T>
void scan(vector<pair<T,T>> &a){
  rep(i,0,a.size()-1)cin>>a[i].first>>a[i].second;
}

template<typename T>
void dec(vector<T> &a){
  rep(i,0,a.size()-1)a[i]--;
}

int lod(ivi &a,int k){
  auto d=lower_bound(all(a),k);
  int e=distance(a.begin(),d);
  return e;
}

int main(){
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  it m;int n;cin>>m>>n;
  assert(1<=m&&m<=10000000000LL);
  assert(min(2LL,m/100000)<=n&&n<=min(m,1000000LL));
  vi x(n);scan(x);
  vms memo(1000001);
  rep(i,1,1000000)
    memo[i]=memo[i-1]+i*i;
  x.insert(x.begin(),0LL);
  x.push_back(m+1);
  rep(i,0,n)
    assert(1<=x[i+1]-x[i]&&x[i+1]-x[i]<=1000000);
  mints sum=0;
  rep(i,0,n)
    sum+=memo[x[i+1]-x[i]-1];
  cout<<sum.val()<<endl;
}
0