Submission #1981579


Source Code Expand

#include <iostream>
#include <string>
#include <stdlib.h>
using namespace std;

int main()
{
  int n, t, count = 0;
  cin >> n >> t;
  int p[n];
  for (int i = 0; i < n; i++)
  {
    cin >> p[i];
  }

  count += t;

  for (int i = 1; i < n; i++)
  {
    if (p[i] - p[i - 1] > t)
    {
      count += t;
    }
    else
    {
      count += p[i];
    }
  }

  cout << count << endl;
}

Submission Info

Submission Time
Task C - Sentou
User non
Language C++14 (GCC 5.4.1)
Score 0
Code Size 414 Byte
Status WA
Exec Time 107 ms
Memory 1024 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 0 / 300
Status
AC × 3
WA × 2
AC × 3
WA × 10
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 WA 1 ms 256 KB
example3 AC 1 ms 256 KB
example4 WA 1 ms 256 KB
maxrand0 WA 105 ms 1024 KB
maxrand1 WA 107 ms 1024 KB
maxrand2 WA 105 ms 1024 KB
rand0 WA 1 ms 256 KB
rand1 WA 1 ms 256 KB
rand2 WA 1 ms 256 KB
rand3 WA 1 ms 256 KB
rand4 WA 1 ms 256 KB