結果
| 問題 |
No.3066 Collecting Coins Speedrun 1
|
| コンテスト | |
| ユーザー |
k82b
|
| 提出日時 | 2025-03-21 21:26:42 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 851 bytes |
| コンパイル時間 | 2,236 ms |
| コンパイル使用メモリ | 198,308 KB |
| 実行使用メモリ | 7,328 KB |
| 最終ジャッジ日時 | 2025-03-21 21:26:46 |
| 合計ジャッジ時間 | 3,821 ms |
|
ジャッジサーバーID (参考情報) |
judge6 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 23 WA * 9 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
using Int = long long;
template <class T> inline bool setmin(T &A, T B){
if (A > B){
A = B;
return true;
} else {
return false;
}
}
template <class T> inline bool setmax(T &A, T B){
if (A < B){
A = B;
return true;
} else {
return false;
}
}
#define REP(x, y) for (int x = 0; x < int(y); ++x)
#define rep(x, y, z) for (int x = int(y); x < int(z); ++x)
#define PER(x, y) for (int x = int(y) - 1; x >= 0; --x)
#define per(x, y, z) for (int x = int(z) - 1; x >= int(y); --x)
void solve(){
int N;
cin >> N;
vector<int> C(N);
REP(i, N){
cin >> C[i];
}
sort(C.begin(), C.end());
int ans = 0;
ans += abs(C[0]) * 2;
ans += abs(C[N - 1]) * 2;
cout << ans << '\n';
}
int main(){
ios::sync_with_stdio(false);
cin.tie(nullptr);
int t = 1;
// cin >> t;
while (t--){
solve();
}
}
k82b