Submission #2233556


Source Code Expand

#include<bits/stdc++.h>
const int INF = 1e9;
const int MOD = 1e9+7;
using namespace std;
#define COUT(v) cout<<(v)<<endl
#define CIN(n)  int(n);cin >> (n)
#define YES(n) cout<<((n)? "YES" : "NO")<<endl
#define Yes(n) cout<<((n)? "Yes" : "No")<<endl
#define POSSIBLE(n) cout << ((n) ? "POSSIBLE" : "IMPOSSIBLE"  ) << endl
#define Possible(n) cout << ((n) ? "Possible" : "Impossible"  ) <<endl

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) for(int i=0;i<(n);++i)
#define REPR(i,n) for(int i=n;i>=0;i--)

#define FOREACH(x,a) for(auto& (x) : (a) )

#define ALL(obj) (obj).begin(),(obj).end()

#define P pair<int,int>
#define I vector<int>
#define S set<int>
#define pb(v) push_back(v)
#define V vector
#define rt return
#define LL long long
int main(){
    CIN(N);
    CIN(T);
    LL ans = T;
    I vec;
    REP(a,N){
        CIN(b);
        vec.pb(b);
    }
    REP(a,N-1){
        ans += T - max(0,T - (vec.at(a+1)-vec.at(a)));
    }
    COUT(ans);
    return 0;
}

Submission Info

Submission Time
Task C - Sentou
User hamuhei4869
Language C++14 (GCC 5.4.1)
Score 300
Code Size 1021 Byte
Status AC
Exec Time 80 ms
Memory 1400 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 300 / 300
Status
AC × 5
AC × 13
Set Name Test Cases
Sample example0, example1, example2, example3, example4
All example0, example1, example2, example3, example4, maxrand0, maxrand1, maxrand2, rand0, rand1, rand2, rand3, rand4
Case Name Status Exec Time Memory
example0 AC 1 ms 256 KB
example1 AC 1 ms 256 KB
example2 AC 1 ms 256 KB
example3 AC 1 ms 256 KB
example4 AC 1 ms 256 KB
maxrand0 AC 80 ms 1400 KB
maxrand1 AC 80 ms 1400 KB
maxrand2 AC 80 ms 1400 KB
rand0 AC 1 ms 256 KB
rand1 AC 1 ms 256 KB
rand2 AC 1 ms 256 KB
rand3 AC 1 ms 256 KB
rand4 AC 1 ms 256 KB