結果

問題 No.1726 [Cherry 3rd Tune B] ジャマイカビアポン
ユーザー cureskolcureskol
提出日時 2021-10-29 22:32:13
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 577 bytes
コンパイル時間 2,343 ms
コンパイル使用メモリ 182,084 KB
実行使用メモリ 50,208 KB
最終ジャッジ日時 2024-04-16 15:23:34
合計ジャッジ時間 32,717 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,820 KB
testcase_01 AC 2 ms
6,940 KB
testcase_02 AC 2 ms
6,940 KB
testcase_03 AC 2 ms
6,940 KB
testcase_04 AC 4 ms
6,940 KB
testcase_05 AC 4 ms
6,940 KB
testcase_06 AC 2 ms
6,940 KB
testcase_07 AC 2 ms
6,944 KB
testcase_08 AC 2 ms
6,944 KB
testcase_09 AC 3 ms
6,940 KB
testcase_10 AC 3 ms
6,940 KB
testcase_11 AC 4 ms
6,944 KB
testcase_12 AC 8 ms
6,940 KB
testcase_13 AC 2 ms
6,940 KB
testcase_14 AC 424 ms
12,288 KB
testcase_15 AC 1,890 ms
27,008 KB
testcase_16 AC 2,449 ms
35,200 KB
testcase_17 AC 1,676 ms
26,240 KB
testcase_18 AC 1,279 ms
22,144 KB
testcase_19 AC 2,432 ms
31,744 KB
testcase_20 AC 533 ms
13,696 KB
testcase_21 AC 2,046 ms
30,208 KB
testcase_22 AC 938 ms
17,792 KB
testcase_23 AC 912 ms
18,304 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
6,944 KB
testcase_35 AC 2 ms
6,948 KB
testcase_36 AC 2 ms
6,944 KB
testcase_37 AC 1 ms
6,940 KB
testcase_38 AC 135 ms
6,940 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){
    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