結果

問題 No.1816 MUL-DIV Game
ユーザー SamShawCraftSamShawCraft
提出日時 2022-01-28 22:31:54
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 55 ms / 2,000 ms
コード長 567 bytes
コンパイル時間 701 ms
コンパイル使用メモリ 53,872 KB
実行使用メモリ 7,772 KB
最終ジャッジ日時 2023-08-28 20:42:07
合計ジャッジ時間 4,026 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 1 ms
4,376 KB
testcase_04 AC 1 ms
4,380 KB
testcase_05 AC 1 ms
4,380 KB
testcase_06 AC 1 ms
4,380 KB
testcase_07 AC 1 ms
4,376 KB
testcase_08 AC 1 ms
4,376 KB
testcase_09 AC 6 ms
4,380 KB
testcase_10 AC 22 ms
5,160 KB
testcase_11 AC 20 ms
4,832 KB
testcase_12 AC 15 ms
4,452 KB
testcase_13 AC 31 ms
5,860 KB
testcase_14 AC 16 ms
4,564 KB
testcase_15 AC 23 ms
5,140 KB
testcase_16 AC 6 ms
4,380 KB
testcase_17 AC 43 ms
6,884 KB
testcase_18 AC 41 ms
6,644 KB
testcase_19 AC 20 ms
4,872 KB
testcase_20 AC 45 ms
7,008 KB
testcase_21 AC 15 ms
4,472 KB
testcase_22 AC 12 ms
4,380 KB
testcase_23 AC 1 ms
4,380 KB
testcase_24 AC 1 ms
4,380 KB
testcase_25 AC 54 ms
7,712 KB
testcase_26 AC 54 ms
7,772 KB
testcase_27 AC 54 ms
7,744 KB
testcase_28 AC 54 ms
7,768 KB
testcase_29 AC 55 ms
7,732 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>
#include <algorithm>
#include <set>
#define qaq inline
const int sz=1e5+19;
using ll=long long;
int n,arr[sz];
std::multiset<ll> ms;
int main(){
  scanf("%d",&n);
  for(int cx=0,u;cx<n;++cx){
    scanf("%d",&u);
    ms.insert(u);
  }
  for(int cx=1;cx<n;++cx){
    if(cx&1){
      ll x=*ms.begin();
      ms.erase(ms.begin());
      ll y=*ms.begin();
      ms.erase(ms.begin());
      ms.insert(1LL*x*y);
    }else{
      ms.erase(--ms.end());
      ms.erase(--ms.end());
      ms.insert(1);
    }
  }
  printf("%lld\n",*ms.begin());
  return 0;
}
0