結果
| 問題 | No.2053 12345... |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-09-24 18:23:46 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 316 bytes |
| 記録 | |
| コンパイル時間 | 1,332 ms |
| コンパイル使用メモリ | 219,684 KB |
| 実行使用メモリ | 21,376 KB |
| 最終ジャッジ日時 | 2026-06-27 17:31:13 |
| 合計ジャッジ時間 | 4,392 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 24 WA * 7 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int N;
cin>>N;
vector<int>A(N);
for(int &i:A)cin>>i;
map<int,long long>cnt;
long long ans=0;
for(int i=0;i<N;i++){
ans+=cnt[A[i]-1];
cnt[A[i]]+=cnt[A[i]-1]+1;
}
cout<<ans<<'\n';
}