結果

問題 No.2053 12345...
ユーザー kstation_kagigikstation_kagigi
提出日時 2022-08-21 20:58:27
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,280 bytes
コンパイル時間 851 ms
コンパイル使用メモリ 97,128 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-04-18 13:12:32
合計ジャッジ時間 3,053 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 2 ms
5,376 KB
testcase_02 WA -
testcase_03 AC 20 ms
5,376 KB
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 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 2 ms
5,376 KB
testcase_23 AC 10 ms
5,376 KB
testcase_24 AC 21 ms
5,376 KB
testcase_25 AC 74 ms
5,376 KB
testcase_26 AC 35 ms
5,376 KB
testcase_27 AC 22 ms
5,376 KB
testcase_28 AC 18 ms
5,376 KB
testcase_29 AC 50 ms
5,376 KB
testcase_30 AC 19 ms
5,376 KB
testcase_31 AC 46 ms
5,376 KB
testcase_32 AC 81 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

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-1);
    }
    cout<<ans<<endl;
}
0