結果

問題 No.2053 12345...
ユーザー kstation_kagigikstation_kagigi
提出日時 2022-08-21 20:57:42
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 1,276 bytes
コンパイル時間 819 ms
コンパイル使用メモリ 98,420 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-10-10 06:24:29
合計ジャッジ時間 3,067 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample WA * 2
other WA * 31
権限があれば一括ダウンロードができます

ソースコード

diff #

//#include<bits/stdc++.h>
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <functional>
#include <iomanip>
#include <iostream>
#include <math.h>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <tuple>
#include <utility>
#include <vector>
#define ALL(s) (s).begin(),(s).end()
using namespace std;
using ll=long long;
using dl=double long;
using str=string;
using graph = vector<vector<ll>>;
template<class T>using Mqu=priority_queue<T>;
template<class T>using mqu=priority_queue<T,vector<T>,greater<T>>;
ll M=1000000007LL;
str alpha="abcdefghijklmnopqrstuvwxyz";
str ALPHA="ABCDEFGHIJKLMNOPQRSTUVWXYZ";
ll bikkuri(ll a){return a?a*bikkuri(a-1):1;}
ll sankakusu(ll a){return a?(a+sankakusu(a-1)):0;}
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return (a/gcd(a,b))*b;}
ll power(ll a,ll b){return b?power(a,b-1)*a:1;}
ll ketawa(ll a){return a<10?a:a%10+ketawa(a/10);}
// <<fixed<<setprecision(n)<<
// do{}while(next_permutation(ALL(s)));
// reverse() is function
int main(void){
    ll n,x=1,ans=0; cin>>n; vector<ll> s(n);
    cin>>s[0];
    for(ll i=1;i<n;i++){
        cin>>s[i];
        if(s[i-1]+1==s[i]) x++;
        else x=0;
        if(x>1) ans+=x;
    }
    cout<<ans<<endl;
}
0