結果

問題 No.2509 Beam Shateki
ユーザー ococonomy1ococonomy1
提出日時 2023-10-20 22:03:20
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 2,086 bytes
コンパイル時間 1,914 ms
コンパイル使用メモリ 125,664 KB
実行使用メモリ 7,760 KB
最終ジャッジ日時 2023-10-20 22:03:42
合計ジャッジ時間 13,492 ms
ジャッジサーバーID
(参考情報)
judge12 / judge10
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
7,760 KB
testcase_01 AC 3 ms
4,348 KB
testcase_02 AC 2 ms
4,348 KB
testcase_03 AC 782 ms
4,348 KB
testcase_04 AC 809 ms
4,348 KB
testcase_05 AC 781 ms
4,348 KB
testcase_06 AC 782 ms
4,348 KB
testcase_07 AC 805 ms
4,348 KB
testcase_08 AC 781 ms
4,348 KB
testcase_09 AC 789 ms
4,348 KB
testcase_10 AC 780 ms
4,348 KB
testcase_11 AC 791 ms
4,348 KB
testcase_12 AC 787 ms
4,348 KB
testcase_13 TLE -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
testcase_36 -- -
testcase_37 -- -
testcase_38 -- -
testcase_39 -- -
testcase_40 -- -
testcase_41 -- -
testcase_42 -- -
testcase_43 -- -
testcase_44 -- -
testcase_45 -- -
testcase_46 -- -
testcase_47 -- -
testcase_48 -- -
testcase_49 -- -
testcase_50 -- -
testcase_51 -- -
testcase_52 -- -
testcase_53 -- -
testcase_54 -- -
testcase_55 -- -
testcase_56 -- -
testcase_57 -- -
testcase_58 -- -
testcase_59 -- -
testcase_60 -- -
testcase_61 -- -
testcase_62 -- -
testcase_63 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#pragma GCC target("avx2")
#pragma GCC optimize("O3")
 #pragma GCC optimize("unroll-loops")
#include <algorithm>
#include <bitset>
#include <cassert>
#include <climits>
#include <cmath>
#include <complex>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <tuple>
#include <vector>
using namespace std;
using lg = long long;
using pii = pair<int, int>;
using pll = pair<lg, lg>;
#define TEST cerr << "TEST" << endl
#define AMARI 998244353
// #define AMARI 1000000007
#define TEMOTO ((sizeof(long double) == 16) ? false : true)
#define TIME_LIMIT 1980 * (TEMOTO ? 1 : 1000)
#define el '\n'
#define El '\n'

#define MULTI_TEST_CASE false
void solve(void) {
    int h,w;
    cin >> h >> w;
    vector<vector<int>> a(h,vector<int>(w));
    for(int i = 0; i < h; i++){
        for(int j = 0; j < w; j++){
            cin >> a[i][j];
        }
    }
    int ans = 0;
    int mhx = max(h,w);
    for(int dx = -1; dx <= 1; dx++){
        for(int dy = -1; dy <= 1; dy++){
            if(dx == 0 && dy == 0)break;
            for(int dx2 = dx; dx2 <= 1; dx2++){
                for(int dy2 = -1; dy2 <= 1; dy2++){
                    if(dx2 == 0 && dy2 == 0)break;
                    for(int k = -1 * mhx; k <= mhx; k++){
                        for(int l = -1 * mhx; l <= mhx; l++){
                            int temp = 0;
                            for(int i = 0; i < h; i++){
                                for(int j = 0; j < w; j++){
                                    if(i * dx + j * dy == k || i * dx2 + j * dy2 == l)temp += a[i][j];
                                }
                            }
                            ans = max(ans,temp);
                        }
                    }
                }
            }
        }
    }
    cout << ans << el;
    return;
}

void calc(void) {
    return;
}

signed main(void) {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    calc();
    int t = 1;
    if(MULTI_TEST_CASE) cin >> t;
    while(t--) {
        solve();
    }
    return 0;
}
0