結果
| 問題 | No.3066 Collecting Coins Speedrun 1 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2025-03-21 21:26:28 |
| 言語 | C++14 (gcc 15.2.0 + boost 1.90.0) |
| 結果 |
AC
|
| 実行時間 | 24 ms / 2,000 ms |
| コード長 | 849 bytes |
| 記録 | |
| コンパイル時間 | 805 ms |
| コンパイル使用メモリ | 183,084 KB |
| 実行使用メモリ | 9,276 KB |
| 最終ジャッジ日時 | 2026-07-07 14:13:41 |
| 合計ジャッジ時間 | 2,733 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge2_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 32 |
ソースコード
#include <bits/stdc++.h>
#define fi first
#define se second
#define rep(i,s,n) for (int i = (s); i < (n); ++i)
#define rrep(i,n,g) for (int i = (n)-1; i >= (g); --i)
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define len(x) (int)(x).size()
#define dup(x,y) (((x)+(y)-1)/(y))
#define pb push_back
#define eb emplace_back
#define Field(T) vector<vector<T>>
#define pq(T) priority_queue<T, vector<T>, greater<T>>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using P = pair<int,int>;
template<class T>bool chmax(T&a,T b){if(a<b){a=b;return 1;}return 0;}
template<class T>bool chmin(T&a,T b){if(b<a){a=b;return 1;}return 0;}
int main() {
int n;
cin >> n;
int a = 0, b = 0;
rep(i,0,n) {
int c;
cin >> c;
a = min(a, c), b = max(b, c);
}
cout << (b-a)*2 << endl;
return 0;
}