제출 #964341

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
9643412024-04-16 16:45:10anango건포도 (IOI09_raisins)C++17
100 / 100
645 ms55432 KiB
#include <bits/stdc++.h>
#define int long long
using namespace std;
vector<vector<int>> grid;
vector<vector<int>> pref;
vector<vector<vector<vector<int>>>> dp; //(i,j) and (k,l)
int rect(int a, int b, int c, int d) {
return pref[c+1][d+1]-pref[c+1][b]-pref[a][d+1]+pref[a][b];
}
signed main() {
//freopen("input.txt", "r", stdin);
//freopen("output.txt", "w", stdout);
int n,m;
cin >> n >> m;
int INF=1000000007;
dp=vector(n,vector(m,vector(n,vector<int>(m,INF))));
pref=vector(n+1,vector<int>(m+1,0));
grid=vector(n,vector<int>(m,0));
for (int i=0; i<n; i++) {
for (int j=0; j<m; j++) {
int x;
cin >> x;
grid[i][j] = x;
}
}
for (int i=1; i<=n; i++) {
for (int j=1; j<=m; j++) {
pref[i][j] = pref[i][j-1]+pref[i-1][j]-pref[i-1][j-1]+grid[i-1][j-1];
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...