結果
| 問題 | No.3066 Collecting Coins Speedrun 1 |
| コンテスト | |
| ユーザー |
tnakao0123
|
| 提出日時 | 2025-03-22 18:22:43 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.90.0) |
| 結果 |
AC
|
| 実行時間 | 7 ms / 2,000 ms |
| コード長 | 488 bytes |
| 記録 | |
| コンパイル時間 | 140 ms |
| コンパイル使用メモリ | 52,372 KB |
| 実行使用メモリ | 9,228 KB |
| 最終ジャッジ日時 | 2026-07-07 20:20:46 |
| 合計ジャッジ時間 | 2,423 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 32 |
ソースコード
/* -*- coding: utf-8 -*-
*
* 3066.cc: No.3066 Collecting Coins Speedrun 1 - yukicoder
*/
#include<cstdio>
#include<algorithm>
using namespace std;
/* constant */
const int MAX_N = 100000;
/* typedef */
/* global variables */
int cs[MAX_N];
/* subroutines */
/* main */
int main() {
int n;
scanf("%d", &n);
for (int i = 0; i < n; i++) scanf("%d", cs + i);
int c0 = min(cs[0], 0), c1 = max(cs[n - 1], 0);
int l = (c1 - c0) * 2;
printf("%d\n", l);
return 0;
}
tnakao0123