結果

問題 No.3066 Collecting Coins Speedrun 1
ユーザー snrnsidy
提出日時 2025-03-21 21:27:48
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 12 ms / 2,000 ms
コード長 363 bytes
コンパイル時間 1,766 ms
コンパイル使用メモリ 191,244 KB
実行使用メモリ 7,328 KB
最終ジャッジ日時 2025-03-21 21:27:53
合計ジャッジ時間 3,002 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 32
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;

int main(void)
{
	cin.tie(0);
	ios::sync_with_stdio(false);

    long long int L = 0;
    long long int R = 0;
    int n;
    long long int t;

    cin >> n;
    for(int i=0;i<n;i++)
    {
        cin >> t;
        if(t < 0) L = max(L,-t);
        else R = max(R,t);
    }

    cout << 2*(L+R) << '\n';
	return 0;
}
0