結果
問題 | No.2509 Beam Shateki |
ユーザー |
|
提出日時 | 2023-10-20 23:07:41 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 6 ms / 2,000 ms |
コード長 | 723 bytes |
コンパイル時間 | 1,723 ms |
コンパイル使用メモリ | 169,456 KB |
実行使用メモリ | 7,424 KB |
最終ジャッジ日時 | 2024-09-20 22:05:06 |
合計ジャッジ時間 | 3,285 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 61 |
ソースコード
#include <bits/stdc++.h> using namespace std; #define int long long const int maxn=105; int u[800]; int res[800][800]; int32_t main() { ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0); int n,m;cin>>n>>m; int a[n][m]; for(int i=0;i<n;++i) { for(int j=0;j<m;++j) { cin>>a[i][j]; vector<int> h={i,j+100,i+j+200,i-j+500}; for(int x:h) { u[x]+=a[i][j]; } for(int x:h) for(int y:h) res[x][y]+=a[i][j]; } } int answ=0; for(int i=0;i<800;++i) { for(int j=0;j<800;++j) { answ=max(answ,u[i]+u[j]-res[i][j]); } } cout<<answ; return 0; }