結果

問題 No.1726 [Cherry 3rd Tune B] ジャマイカビアポン
ユーザー auauaauaua
提出日時 2021-10-29 22:43:14
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 1,325 bytes
コンパイル時間 1,894 ms
コンパイル使用メモリ 175,244 KB
実行使用メモリ 43,668 KB
最終ジャッジ日時 2023-09-02 11:54:15
合計ジャッジ時間 50,265 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,384 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 2 ms
4,380 KB
testcase_03 AC 2 ms
4,376 KB
testcase_04 AC 4 ms
4,380 KB
testcase_05 AC 4 ms
4,376 KB
testcase_06 AC 3 ms
4,380 KB
testcase_07 AC 2 ms
4,376 KB
testcase_08 AC 2 ms
4,376 KB
testcase_09 AC 3 ms
4,380 KB
testcase_10 AC 3 ms
4,376 KB
testcase_11 AC 4 ms
4,376 KB
testcase_12 AC 8 ms
4,384 KB
testcase_13 AC 2 ms
4,380 KB
testcase_14 AC 401 ms
12,032 KB
testcase_15 AC 1,598 ms
26,736 KB
testcase_16 AC 2,504 ms
35,000 KB
testcase_17 AC 1,452 ms
26,220 KB
testcase_18 AC 1,117 ms
21,872 KB
testcase_19 AC 2,206 ms
31,680 KB
testcase_20 AC 490 ms
13,604 KB
testcase_21 AC 1,858 ms
30,064 KB
testcase_22 AC 872 ms
17,584 KB
testcase_23 AC 858 ms
18,260 KB
testcase_24 TLE -
testcase_25 TLE -
testcase_26 TLE -
testcase_27 TLE -
testcase_28 TLE -
testcase_29 TLE -
testcase_30 TLE -
testcase_31 TLE -
testcase_32 TLE -
testcase_33 TLE -
testcase_34 AC 2 ms
4,380 KB
testcase_35 AC 1 ms
4,380 KB
testcase_36 AC 1 ms
4,380 KB
testcase_37 AC 2 ms
4,380 KB
testcase_38 AC 132 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
#define int long long
#define REP(i,m,n) for(int i=(m);i<(n);i++)
#define rep(i,n) REP(i,0,n)
#define pb push_back
#define all(a) a.begin(),a.end()
#define rall(c) (c).rbegin(),(c).rend()
#define mp make_pair
#define endl '\n'
//#define vec vector<ll>
//#define mat vector<vector<ll> >
#define fi first
#define se second
#define double long double
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll,ll> pll;
//typedef long double ld;
typedef complex<double> Complex;
const ll INF=1e9+7;
const ll MOD=998244353;
const ll inf=INF*INF;
const ll mod=MOD;
const ll MAX=200010;
const double PI=acos(-1.0);
typedef vector<vector<ll> > mat;
typedef vector<ll> vec;



void solve(){
    ll n,m;cin>>n>>m;
    vector<ll>p(n);
    rep(i,n)cin>>p[i];
    vector<ll>a(n),b(n),c(m),d(m);
    rep(i,n)cin>>a[i]>>b[i];
    rep(i,m)cin>>c[i]>>d[i];
    ll z=1,w=1;
    ll ans=0;
    rep(x,2){
        z*=(-1);
        rep(y,2){
            w*=(-1);
            map<pll,ll>ma;
            rep(i,n){
                rep(j,m){
                    ma[mp(c[j]-a[i]*z,d[j]-b[i]*w)]+=p[i];
                }
            }
            for(auto e:ma)ans=max(ans,e.se);
        }
    }
    cout<<ans<<endl;
}

signed main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    solve();
}
0