結果

問題 No.1816 MUL-DIV Game
ユーザー ktr216ktr216
提出日時 2022-01-21 21:38:29
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,099 bytes
コンパイル時間 1,497 ms
コンパイル使用メモリ 173,364 KB
実行使用メモリ 8,960 KB
最終ジャッジ日時 2024-05-04 12:14:19
合計ジャッジ時間 3,340 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
5,248 KB
testcase_01 AC 2 ms
5,376 KB
testcase_02 AC 1 ms
5,376 KB
testcase_03 AC 2 ms
5,376 KB
testcase_04 AC 1 ms
5,376 KB
testcase_05 AC 2 ms
5,376 KB
testcase_06 AC 2 ms
5,376 KB
testcase_07 AC 2 ms
5,376 KB
testcase_08 AC 1 ms
5,376 KB
testcase_09 AC 8 ms
5,376 KB
testcase_10 AC 35 ms
5,632 KB
testcase_11 AC 32 ms
5,504 KB
testcase_12 AC 24 ms
5,376 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 AC 88 ms
8,704 KB
testcase_27 WA -
testcase_28 AC 90 ms
8,832 KB
testcase_29 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

using ll = long long;
using VI = vector<int>;
using P = pair<int, int>;

#define REP(i, n) for (int i = 0; i < (int)(n); i++)
#define FOR(i, a, b) for (ll i = a; i < (ll)(b); i++)
#define ALL(a) (a).begin(),(a).end()

constexpr int INF = 1001001001;
constexpr ll LINF = 1001001001001001001ll;
constexpr int DX[] = {1, 0, -1, 0};
constexpr int DY[] = {0, 1, 0, -1};

template< typename T1, typename T2>
inline bool chmax(T1 &a, T2 b) {return a < b && (a = b, true); }
template< typename T1, typename T2>
inline bool chmin(T1 &a, T2 b) {return a > b && (a = b, true); }

const ll MOD = 1000000007;

int main() {
    int N;
    cin >> N;
    vector <ll> A(N);
    multiset<ll> st;
    REP(i, N) {
        cin >> A[i];
        st.insert(-A[i]);
    }
    REP(i, N - 1) {
        ll x = -*st.begin();
        st.erase(st.find(-x));
        ll y = -*st.begin();
        st.erase(st.find(-y));
        if (i % 2) {
            st.insert(-((y + x - 1) / x));
        } else {
            st.insert(-(x * y));
        }
    }
    cout << -*st.begin() << endl;
}
0