結果
| 問題 |
No.1816 MUL-DIV Game
|
| コンテスト | |
| ユーザー |
se1ka2
|
| 提出日時 | 2022-01-21 21:39:18 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 485 bytes |
| コンパイル時間 | 564 ms |
| コンパイル使用メモリ | 71,928 KB |
| 実行使用メモリ | 15,872 KB |
| 最終ジャッジ日時 | 2024-11-25 23:04:51 |
| 合計ジャッジ時間 | 18,890 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 RE * 1 |
| other | AC * 14 RE * 8 TLE * 5 |
ソースコード
#include <iostream>
#include <set>
using namespace std;
typedef long long ll;
int main()
{
int n;
cin >> n;
multiset<ll> st;
for(int i = 0; i < n; i++){
ll a;
cin >> a;
st.insert(a);
}
for(int i = 0; i < n - 1; i++){
if(i % 2 == 0){
ll a = *st.begin();
st.erase(st.begin());
ll b = *st.begin();
st.erase(st.begin());
st.insert(a * b);
}
else{
st.erase(*--st.end());
st.erase(*--st.end());
st.insert(1);
}
}
cout << *st.begin() << endl;
}
se1ka2