結果
問題 | No.3066 Collecting Coins Speedrun 1 |
ユーザー |
![]() |
提出日時 | 2025-03-21 21:27:09 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 12 ms / 2,000 ms |
コード長 | 465 bytes |
コンパイル時間 | 5,773 ms |
コンパイル使用メモリ | 332,476 KB |
実行使用メモリ | 7,328 KB |
最終ジャッジ日時 | 2025-03-21 21:27:17 |
合計ジャッジ時間 | 6,284 ms |
ジャッジサーバーID (参考情報) |
judge6 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 32 |
ソースコード
#include <atcoder/all> #include <bits/stdc++.h> #define rep(i, a, b) for (ll i = (ll)(a); i < (ll)(b); i++) using namespace atcoder; using namespace std; typedef long long ll; int main() { cin.tie(0); cout.tie(0); ios::sync_with_stdio(0); int n; cin >> n; int mn = 0, mx = 0; rep(i, 0, n) { int x; cin >> x; mn = min(mn, x); mx = max(mx, x); } mn = abs(mn); cout << (mn + mx) * 2 << endl; }