Submission #1035452

# Submission time Handle Problem Language Result Execution time Memory
1035452 2024-07-26T11:19:06 Z Abito Rectangles (IOI19_rect) C++17
10 / 100
17 ms 20692 KB
#include "rect.h"
#include <bits/stdc++.h>
using namespace std;
const int N=2505;
int n,m,a[5][N],mx[N][N],p[N];
long long count_rectangles(vector<vector<int>> v){
    n=v.size();
    m=v[0].size();
    if (n<=2 || m<=2) return 0LL;
    for (int i=1;i<=n;i++) for (int j=1;j<=m;j++) a[i][j]=v[i-1][j-1];
    for (int j=2;j<m;j++) p[j]=p[j-1]+bool(a[2][j]<a[1][j] && a[2][j]<a[3][j]);
    for (int i=2;i<m;i++){
        mx[i][i]=a[2][i];
        for (int j=i+1;j<m;j++){
            mx[i][j]=max(mx[i][j-1],a[2][j]);
        }
    }
    long long ans=0;
    for (int i=2;i<m;i++) for (int j=i;j<m;j++) ans+=bool(p[j]-p[i-1]==j-i+1 && mx[i][j]<a[2][i-1] && mx[i][j]<a[2][j+1]);
    return ans;
}
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 12 ms 20692 KB Output is correct
2 Correct 10 ms 16984 KB Output is correct
3 Correct 11 ms 20544 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 12 ms 20572 KB Output is correct
6 Correct 17 ms 20572 KB Output is correct
7 Correct 13 ms 20572 KB Output is correct
8 Correct 13 ms 20572 KB Output is correct
9 Correct 14 ms 20572 KB Output is correct
10 Correct 1 ms 604 KB Output is correct
11 Correct 0 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 348 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB Output isn't correct
2 Halted 0 ms 0 KB -