結果

問題 No.1726 [Cherry 3rd Tune B] ジャマイカビアポン
ユーザー 👑 NachiaNachia
提出日時 2023-08-23 20:12:43
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,635 bytes
コンパイル時間 895 ms
コンパイル使用メモリ 98,104 KB
実行使用メモリ 105,348 KB
最終ジャッジ日時 2023-08-23 20:13:15
合計ジャッジ時間 30,676 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 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 3 ms
4,376 KB
testcase_05 AC 3 ms
4,380 KB
testcase_06 AC 2 ms
4,380 KB
testcase_07 AC 2 ms
4,376 KB
testcase_08 AC 2 ms
4,376 KB
testcase_09 AC 2 ms
4,380 KB
testcase_10 AC 2 ms
4,380 KB
testcase_11 AC 4 ms
4,376 KB
testcase_12 AC 6 ms
4,376 KB
testcase_13 AC 2 ms
4,376 KB
testcase_14 AC 292 ms
25,860 KB
testcase_15 AC 1,239 ms
72,088 KB
testcase_16 AC 1,586 ms
88,688 KB
testcase_17 AC 1,202 ms
72,680 KB
testcase_18 AC 828 ms
50,372 KB
testcase_19 AC 1,402 ms
81,640 KB
testcase_20 AC 370 ms
28,820 KB
testcase_21 AC 1,356 ms
78,376 KB
testcase_22 AC 619 ms
42,060 KB
testcase_23 AC 651 ms
43,472 KB
testcase_24 AC 1,884 ms
104,028 KB
testcase_25 AC 1,853 ms
105,220 KB
testcase_26 AC 1,881 ms
105,348 KB
testcase_27 AC 1,839 ms
105,176 KB
testcase_28 AC 1,833 ms
104,924 KB
testcase_29 AC 1,812 ms
104,888 KB
testcase_30 WA -
testcase_31 AC 1,845 ms
104,796 KB
testcase_32 AC 1,856 ms
104,776 KB
testcase_33 AC 1,862 ms
103,700 KB
testcase_34 AC 1 ms
4,380 KB
testcase_35 AC 2 ms
4,376 KB
testcase_36 AC 2 ms
4,376 KB
testcase_37 AC 2 ms
4,380 KB
testcase_38 AC 41 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <algorithm>
#include <unordered_map>
using namespace std;
using i32 = int32_t;
using u32 = uint32_t;
using i64 = int64_t;
using u64 = uint64_t;
#define rep(i,n) for(int i=0; i<(n); i++)


struct Pos2{
  int x,y;
};

bool operator<(Pos2 l, Pos2 r){
  if(l.x != r.x) return l.x < r.x;
  return l.y < r.y;
}

Pos2 operator-(Pos2 l, Pos2 r){
  return { l.x - r.x, l.y - r.y };
}


int main(){
  int num_cup; cin >> num_cup;
  int num_ball; cin >> num_ball;
  vector<int> score_cup(num_cup);
  for(auto& a : score_cup) cin >> a;
  vector<Pos2> pos_cup(num_cup);
  for(auto& a : pos_cup) cin >> a.x >> a.y;
  vector<Pos2> pos_ball(num_ball);
  for(auto& a : pos_ball) cin >> a.x >> a.y;

  unordered_map<long long, int> score_table[2][2]; // reversed or not for x,y
  for(int cupi = 0; cupi < num_cup; cupi++){
    for(int balli = 0; balli < num_ball; balli++){
      for(int x_reversed : { 0, 1 }){
        for(int y_reversed : { 0, 1 }){
          auto p = pos_ball[balli] - pos_cup[cupi];
          score_table[x_reversed][y_reversed][(long long)(p.x + 1000010000) << 32 | (p.y + 1000010000)] += score_cup[cupi];
          pos_ball[balli].y *= -1;
        }
        pos_ball[balli].x *= -1;
      }
    }
  }

  int ans = 0;
  for(int x_reversed : { 0, 1 }){
    for(int y_reversed : { 0, 1 }){
      for(auto a : score_table[x_reversed][y_reversed]){
        ans = max(ans, a.second);
      }
    }
  }
  cout << ans << "\n";
  return 0;
}




struct ios_do_not_sync {
    ios_do_not_sync() {
        ios::sync_with_stdio(false);
        cin.tie(nullptr);
    }
} ios_do_not_sync_instance;
0