結果
問題 | No.1726 [Cherry 3rd Tune B] ジャマイカビアポン |
ユーザー | auaua |
提出日時 | 2021-10-29 23:08:08 |
言語 | C++14 (gcc 13.2.0 + boost 1.83.0) |
結果 |
TLE
(最新)
AC
(最初)
|
実行時間 | - |
コード長 | 1,621 bytes |
コンパイル時間 | 1,946 ms |
コンパイル使用メモリ | 177,164 KB |
実行使用メモリ | 43,776 KB |
最終ジャッジ日時 | 2024-04-16 15:48:20 |
合計ジャッジ時間 | 37,340 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 2 ms
5,248 KB |
testcase_01 | AC | 2 ms
5,376 KB |
testcase_02 | AC | 2 ms
5,376 KB |
testcase_03 | AC | 2 ms
5,376 KB |
testcase_04 | AC | 4 ms
5,376 KB |
testcase_05 | AC | 5 ms
5,376 KB |
testcase_06 | AC | 2 ms
5,376 KB |
testcase_07 | AC | 2 ms
5,376 KB |
testcase_08 | AC | 2 ms
5,376 KB |
testcase_09 | AC | 3 ms
5,376 KB |
testcase_10 | AC | 3 ms
5,376 KB |
testcase_11 | AC | 4 ms
5,376 KB |
testcase_12 | AC | 8 ms
5,376 KB |
testcase_13 | AC | 2 ms
5,376 KB |
testcase_14 | AC | 370 ms
12,160 KB |
testcase_15 | AC | 1,615 ms
26,880 KB |
testcase_16 | AC | 2,473 ms
35,328 KB |
testcase_17 | AC | 1,508 ms
26,240 KB |
testcase_18 | AC | 1,133 ms
22,016 KB |
testcase_19 | AC | 2,247 ms
31,872 KB |
testcase_20 | AC | 507 ms
13,696 KB |
testcase_21 | AC | 1,893 ms
30,208 KB |
testcase_22 | AC | 809 ms
17,664 KB |
testcase_23 | AC | 878 ms
18,432 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
5,376 KB |
testcase_35 | AC | 2 ms
5,376 KB |
testcase_36 | AC | 2 ms
5,376 KB |
testcase_37 | AC | 2 ms
5,376 KB |
testcase_38 | AC | 120 ms
5,376 KB |
ソースコード
#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; #pragma GCC target("avx2") #pragma GCC optimize("O3") #pragma GCC optimize("unroll-loops") 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; ll zz=INF*4; ll zzz=INF*2; rep(x,2){ z*=(-1); rep(i,n)a[i]*=z; rep(y,2){ w*=(-1); rep(j,n)b[j]*=w; map<ll,ll>ma; rep(i,n){ ll pi=p[i]; ll ai=a[i],bi=b[i]; rep(j,m){ ma[(c[j]-ai+zzz)*zz+d[j]-bi+zzz]+=pi; } } for(auto e:ma)ans=max(ans,e.se); rep(j,n)b[j]*=w; } rep(i,n)a[i]*=z; } cout<<ans<<endl; } signed main(){ cin.tie(0); ios::sync_with_stdio(false); solve(); }