結果
| 問題 |
No.1816 MUL-DIV Game
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-01-21 21:29:42 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 770 bytes |
| コンパイル時間 | 1,679 ms |
| コンパイル使用メモリ | 172,292 KB |
| 実行使用メモリ | 7,936 KB |
| 最終ジャッジ日時 | 2024-11-25 22:44:25 |
| 合計ジャッジ時間 | 6,519 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 6 WA * 1 RE * 20 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n) for(ll i=0; i<(ll)n; i++)
#define reps(i,n) for(ll i=1; i<=(ll)n; i++)
#define repi(i,a,b) for(ll i=(ll)a; i<(ll)b; i++)
#define pb push_back
#define mp make_pair
#define ALL(i) i.begin(),i.end()
ll INF = 1000000000000000;
int main() {
cin.tie(nullptr);
ios::sync_with_stdio(false);
ll n; cin >> n;
ll a;
multiset<ll> st;
rep(i,n) {
cin >> a;
st.insert(a);
}
ll now=0;
while(st.size()!=1){
ll v=*prev(st.end());
ll w=*prev(prev(st.end()));
st.erase(st.find(v));
st.erase(st.find(w));
if(now) st.insert(w/v);
else st.insert(v*w);
now++;
}
cout << *st.begin() << endl;
}