結果

問題 No.1726 [Cherry 3rd Tune B] ジャマイカビアポン
ユーザー cureskolcureskol
提出日時 2021-10-29 22:33:48
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 1,612 ms / 3,000 ms
コード長 587 bytes
コンパイル時間 2,322 ms
コンパイル使用メモリ 182,604 KB
実行使用メモリ 33,288 KB
最終ジャッジ日時 2024-04-16 15:25:52
合計ジャッジ時間 25,181 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 1 ms
5,376 KB
testcase_02 AC 2 ms
5,376 KB
testcase_03 AC 2 ms
5,376 KB
testcase_04 AC 3 ms
5,376 KB
testcase_05 AC 3 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 2 ms
5,376 KB
testcase_10 AC 2 ms
5,376 KB
testcase_11 AC 3 ms
5,376 KB
testcase_12 AC 6 ms
5,376 KB
testcase_13 AC 3 ms
5,376 KB
testcase_14 AC 136 ms
9,420 KB
testcase_15 AC 865 ms
24,460 KB
testcase_16 AC 1,166 ms
28,728 KB
testcase_17 AC 824 ms
24,224 KB
testcase_18 AC 497 ms
16,508 KB
testcase_19 AC 1,024 ms
27,340 KB
testcase_20 AC 161 ms
10,584 KB
testcase_21 AC 972 ms
25,092 KB
testcase_22 AC 329 ms
14,484 KB
testcase_23 AC 329 ms
15,352 KB
testcase_24 AC 1,612 ms
31,880 KB
testcase_25 AC 1,504 ms
31,376 KB
testcase_26 AC 1,535 ms
33,288 KB
testcase_27 AC 1,553 ms
31,372 KB
testcase_28 AC 1,553 ms
32,740 KB
testcase_29 AC 1,542 ms
30,780 KB
testcase_30 AC 1,502 ms
33,164 KB
testcase_31 AC 1,516 ms
31,284 KB
testcase_32 AC 1,511 ms
32,852 KB
testcase_33 AC 1,493 ms
30,460 KB
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 31 ms
5,376 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function 'int main()':
main.cpp:21:14: warning: structured bindings only available with '-std=c++17' or '-std=gnu++17' [-Wc++17-extensions]
   21 |     for(auto [xy,va]:mp)ans=max(ans,va);
      |              ^

ソースコード

diff #

#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
using namespace std;

#define REP(i,n) for(int i=0;i<(n);i++)
using ll=long long;
const ll M=2e9+3;

int main(){
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  
  int n,m,ans=0;cin>>n>>m;
  vector<int> v(n),a(n),b(n),c(m),d(m);
  REP(i,n)cin>>v[i];
  REP(i,n)cin>>a[i]>>b[i];
  REP(j,m)cin>>c[j]>>d[j];
  REP(k,4){
    unordered_map<ll,int> mp;
    REP(i,n)REP(j,m)mp[ (a[i]-c[j])*M + (b[i]-d[j]) ]+=v[i];
    for(auto [xy,va]:mp)ans=max(ans,va);
    REP(i,n)a[i]*=-1;
    if(k==1)REP(i,n)b[i]*=-1;
  }
  cout<<ans<<endl;
}
  
0