結果
問題 | No.505 カードの数式2 |
ユーザー |
![]() |
提出日時 | 2017-04-21 22:34:05 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
TLE
(最新)
AC
(最初)
|
実行時間 | - |
コード長 | 856 bytes |
コンパイル時間 | 1,911 ms |
コンパイル使用メモリ | 180,644 KB |
実行使用メモリ | 382,240 KB |
最終ジャッジ日時 | 2024-09-25 02:06:56 |
合計ジャッジ時間 | 8,123 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 25 TLE * 1 -- * 3 |
ソースコード
#include <bits/stdc++.h>using namespace std;#define REP(i,a,n) for(int i=(a); i<(int)(n); i++)#define rep(i,n) REP(i,0,n)#define FOR(it,c) for(__typeof((c).begin()) it=(c).begin(); it!=(c).end(); ++it)#define ALLOF(c) (c).begin(), (c).end()typedef long long ll;typedef unsigned long long ull;int main(){int N;cin >> N;vector<ll> v;rep(i,N){ll a;cin >> a;v.push_back(a);}map<ll,int> memo;memo[v[0]] = 1;REP(i,1,N){map<ll,int> tmp;FOR(it,memo){//+tmp[it->first + v[i]] = 1;//-tmp[it->first - v[i]] = 1;//*tmp[it->first * v[i]] = 1;//divif(v[i]!=0){tmp[it->first / v[i]] = 1;}}memo = tmp;}ll mx = -1000000000000000000LL;FOR(it,memo){mx = max(mx, it->first);}cout << mx << endl;return 0;}