# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1068245 | pcc | Rectangles (IOI19_rect) | C++17 | 208 ms | 147816 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "rect.h"
#include <bits/stdc++.h>
using namespace std;
#pragma GCC target("avx2,popcnt,sse4")
#pragma GCC optimize("O3,unroll-loops")
#define ll long long
vector<vector<int>> pref,arr,row,col;
int N,M;
int sum(int sr,int er,int sc,int ec){
sr++,er++,sc++,ec++;
return pref[er][ec]-pref[sr-1][ec]-pref[er][sc-1]+pref[sr-1][sc-1];
}
long long count_rectangles(std::vector<std::vector<int> > a) {
N = a.size(),M = a[0].size();
pref = vector<vector<int>>(N+1,vector<int>(M+1,0));
row = col = pref;
arr = a;
for(int i = 0;i<N;i++){
for(int j = 0;j<M;j++){
pref[i+1][j+1] = arr[i][j];
}
}
for(int i = 1;i<=N;i++){
for(int j = 1;j<=M;j++){
pref[i][j] += pref[i-1][j]+pref[i][j-1]-pref[i-1][j-1];
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |