結果

問題 No.2055 12x34...
ユーザー StstoneStstone
提出日時 2022-10-15 17:44:43
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,271 bytes
コンパイル時間 3,320 ms
コンパイル使用メモリ 219,548 KB
実行使用メモリ 6,460 KB
最終ジャッジ日時 2023-09-09 02:55:42
合計ジャッジ時間 9,425 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
4,376 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 RE -
testcase_13 RE -
testcase_14 RE -
testcase_15 RE -
testcase_16 RE -
testcase_17 RE -
testcase_18 RE -
testcase_19 RE -
testcase_20 RE -
testcase_21 RE -
testcase_22 RE -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
testcase_34 WA -
testcase_35 WA -
testcase_36 WA -
testcase_37 WA -
testcase_38 WA -
testcase_39 WA -
testcase_40 WA -
testcase_41 WA -
testcase_42 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#pragma GCC optimize("Ofast")
#pragma GCC optimize(1)
#pragma GCC optimize(2)
#pragma GCC optimize(3)
#pragma GCC target("popcnt")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef string str;
typedef pair<ll,ll> pii;
#define F first
#define S second
#define pb push_back
#define pq priority_queue
#define all(x) (x).begin(),(x).end()
#define bug(x) cerr << (x) << '\n'
#define yn(x) cout << (x==1?"Yes\n":"No\n")
#define PI 3.14159265358979323
#define Ststone ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
const ll max_n=2e5+20,max_int=2147483647,mod1=1e9+7,mod2=998244353;
ll dx[8] = {1,0,0,-1,1,1,-1,-1};
ll dy[8] = {0,1,-1,0,1,-1,1,-1};
ll t,n,q,m,k,a,b,c,d,e,f,x,sum,ans[max_n],knt[max_n];
vector<ll> v,v1,v2;
char cc;

void solve(){
    ans[0] = 0;
    cin >> n;
    for(ll i=0;i<n;i++){
        cin >> a;
        knt[a]++;
        ans[a] += ans[a-1]+knt[a-1];
    }
    ll cnt = 0;
    for(ll i=1;i<max_n;i++){
        cnt += ans[i];
    }
    cout << cnt;
}



int main(){
    Ststone;/*
    #ifndef ONLINE_JUDGE
    freopen("input.txt","r",stdin);
    freopen("output.txt","w",stdout);
    #else
    #endif*/
    //cin >> t;
    t = 1;
    for(ll i=1;i<=t;i++){
        //cout << "Case #"<<i<<": ";
        solve();
    }
}

/*
*/
0