結果
| 問題 |
No.2335 Jump
|
| コンテスト | |
| ユーザー |
tnakao0123
|
| 提出日時 | 2023-06-27 19:13:03 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 16 ms / 2,000 ms |
| コード長 | 478 bytes |
| コンパイル時間 | 265 ms |
| コンパイル使用メモリ | 41,156 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-07-04 11:50:22 |
| 合計ジャッジ時間 | 1,723 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 20 |
ソースコード
/* -*- coding: utf-8 -*-
*
* 2335.cc: No.2335 Jump - yukicoder
*/
#include<cstdio>
#include<algorithm>
using namespace std;
/* constant */
const int MAX_N = 100000;
/* typedef */
/* global variables */
int as[MAX_N];
/* subroutines */
/* main */
int main() {
int n;
scanf("%d", &n);
for (int i = 0; i < n; i++) scanf("%d", as + i);
int sum = as[0] - 1;
for (int i = 1; i < n; i++) sum += as[i] - as[i - 1] - 1;
printf("%d\n", sum);
return 0;
}
tnakao0123