답안 #1021414

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1021414 2024-07-12T17:45:23 Z vjudge1 Rectangles (IOI19_rect) C++17
37 / 100
5000 ms 28308 KB
#include "rect.h"
#include<bits/stdc++.h>
using namespace std;

long long count_rectangles(vector<vector<int> > a) {
    long long r=0;
    for(int i1=1;i1<a.size()-1;i1++)
    for(int i2=i1;i2<a.size()-1;i2++)
    for(int j1=1;j1<a[0].size()-1;j1++)
    for(int j2=j1;j2<a[0].size()-1;j2++){
    int b=1;
    for(int k1=i1;b&&k1<=i2;k1++)
    for(int k2=j1;b&&k2<=j2;k2++)
    if(a[i1-1][k2]<=a[k1][k2]||a[i2+1][k2]<=a[k1][k2]||a[k1][j1-1]<=a[k1][k2]||a[k1][j2+1]<=a[k1][k2])b=0;
    if(b)r++;
    }
    return r;
}

Compilation message

rect.cpp: In function 'long long int count_rectangles(std::vector<std::vector<int> >)':
rect.cpp:7:20: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::vector<int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
    7 |     for(int i1=1;i1<a.size()-1;i1++)
      |                  ~~^~~~~~~~~~~
rect.cpp:8:21: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::vector<int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
    8 |     for(int i2=i1;i2<a.size()-1;i2++)
      |                   ~~^~~~~~~~~~~
rect.cpp:9:20: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
    9 |     for(int j1=1;j1<a[0].size()-1;j1++)
      |                  ~~^~~~~~~~~~~~~~
rect.cpp:10:21: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   10 |     for(int j2=j1;j2<a[0].size()-1;j2++){
      |                   ~~^~~~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Correct 1 ms 344 KB Output is correct
4 Correct 1 ms 348 KB Output is correct
5 Correct 1 ms 348 KB Output is correct
6 Correct 2 ms 348 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Correct 1 ms 348 KB Output is correct
10 Correct 1 ms 348 KB Output is correct
11 Correct 1 ms 348 KB Output is correct
12 Correct 1 ms 348 KB Output is correct
13 Correct 0 ms 348 KB Output is correct
14 Correct 0 ms 348 KB Output is correct
15 Correct 0 ms 348 KB Output is correct
16 Correct 0 ms 348 KB Output is correct
17 Correct 0 ms 428 KB Output is correct
18 Correct 0 ms 344 KB Output is correct
19 Correct 1 ms 348 KB Output is correct
20 Correct 0 ms 348 KB Output is correct
21 Correct 1 ms 348 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Correct 1 ms 344 KB Output is correct
4 Correct 1 ms 348 KB Output is correct
5 Correct 1 ms 348 KB Output is correct
6 Correct 2 ms 348 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Correct 1 ms 348 KB Output is correct
10 Correct 1 ms 348 KB Output is correct
11 Correct 1 ms 348 KB Output is correct
12 Correct 1 ms 348 KB Output is correct
13 Correct 0 ms 348 KB Output is correct
14 Correct 0 ms 348 KB Output is correct
15 Correct 0 ms 348 KB Output is correct
16 Correct 0 ms 348 KB Output is correct
17 Correct 0 ms 428 KB Output is correct
18 Correct 0 ms 344 KB Output is correct
19 Correct 1 ms 348 KB Output is correct
20 Correct 0 ms 348 KB Output is correct
21 Correct 1 ms 348 KB Output is correct
22 Correct 38 ms 348 KB Output is correct
23 Correct 35 ms 344 KB Output is correct
24 Correct 36 ms 348 KB Output is correct
25 Correct 26 ms 344 KB Output is correct
26 Correct 28 ms 348 KB Output is correct
27 Correct 28 ms 348 KB Output is correct
28 Correct 29 ms 348 KB Output is correct
29 Correct 12 ms 352 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Correct 1 ms 344 KB Output is correct
4 Correct 1 ms 348 KB Output is correct
5 Correct 1 ms 348 KB Output is correct
6 Correct 2 ms 348 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Correct 1 ms 348 KB Output is correct
10 Correct 1 ms 348 KB Output is correct
11 Correct 1 ms 348 KB Output is correct
12 Correct 1 ms 348 KB Output is correct
13 Correct 0 ms 348 KB Output is correct
14 Correct 0 ms 348 KB Output is correct
15 Correct 0 ms 348 KB Output is correct
16 Correct 0 ms 348 KB Output is correct
17 Correct 38 ms 348 KB Output is correct
18 Correct 35 ms 344 KB Output is correct
19 Correct 36 ms 348 KB Output is correct
20 Correct 26 ms 344 KB Output is correct
21 Correct 28 ms 348 KB Output is correct
22 Correct 28 ms 348 KB Output is correct
23 Correct 29 ms 348 KB Output is correct
24 Correct 12 ms 352 KB Output is correct
25 Correct 0 ms 428 KB Output is correct
26 Correct 0 ms 344 KB Output is correct
27 Correct 1 ms 348 KB Output is correct
28 Correct 0 ms 348 KB Output is correct
29 Correct 1 ms 348 KB Output is correct
30 Correct 1421 ms 956 KB Output is correct
31 Correct 1470 ms 860 KB Output is correct
32 Correct 1448 ms 860 KB Output is correct
33 Correct 1000 ms 812 KB Output is correct
34 Correct 1199 ms 1112 KB Output is correct
35 Correct 1137 ms 1036 KB Output is correct
36 Correct 1202 ms 1000 KB Output is correct
37 Correct 1151 ms 1028 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Correct 1 ms 344 KB Output is correct
4 Correct 1 ms 348 KB Output is correct
5 Correct 1 ms 348 KB Output is correct
6 Correct 2 ms 348 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Correct 1 ms 348 KB Output is correct
10 Correct 1 ms 348 KB Output is correct
11 Correct 1 ms 348 KB Output is correct
12 Correct 1 ms 348 KB Output is correct
13 Correct 0 ms 348 KB Output is correct
14 Correct 0 ms 348 KB Output is correct
15 Correct 0 ms 348 KB Output is correct
16 Correct 0 ms 348 KB Output is correct
17 Correct 38 ms 348 KB Output is correct
18 Correct 35 ms 344 KB Output is correct
19 Correct 36 ms 348 KB Output is correct
20 Correct 26 ms 344 KB Output is correct
21 Correct 28 ms 348 KB Output is correct
22 Correct 28 ms 348 KB Output is correct
23 Correct 29 ms 348 KB Output is correct
24 Correct 12 ms 352 KB Output is correct
25 Correct 1421 ms 956 KB Output is correct
26 Correct 1470 ms 860 KB Output is correct
27 Correct 1448 ms 860 KB Output is correct
28 Correct 1000 ms 812 KB Output is correct
29 Correct 1199 ms 1112 KB Output is correct
30 Correct 1137 ms 1036 KB Output is correct
31 Correct 1202 ms 1000 KB Output is correct
32 Correct 1151 ms 1028 KB Output is correct
33 Correct 0 ms 428 KB Output is correct
34 Correct 0 ms 344 KB Output is correct
35 Correct 1 ms 348 KB Output is correct
36 Correct 0 ms 348 KB Output is correct
37 Correct 1 ms 348 KB Output is correct
38 Execution timed out 5011 ms 7328 KB Time limit exceeded
39 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 19 ms 344 KB Output is correct
2 Correct 14 ms 348 KB Output is correct
3 Correct 7 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 10 ms 560 KB Output is correct
6 Correct 11 ms 348 KB Output is correct
7 Correct 10 ms 556 KB Output is correct
8 Correct 10 ms 532 KB Output is correct
9 Correct 10 ms 348 KB Output is correct
10 Correct 1 ms 344 KB Output is correct
11 Correct 1 ms 348 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 428 KB Output is correct
2 Correct 0 ms 344 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 1 ms 348 KB Output is correct
6 Correct 1 ms 344 KB Output is correct
7 Execution timed out 5089 ms 28308 KB Time limit exceeded
8 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Correct 1 ms 344 KB Output is correct
4 Correct 1 ms 348 KB Output is correct
5 Correct 1 ms 348 KB Output is correct
6 Correct 2 ms 348 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Correct 1 ms 348 KB Output is correct
10 Correct 1 ms 348 KB Output is correct
11 Correct 1 ms 348 KB Output is correct
12 Correct 1 ms 348 KB Output is correct
13 Correct 0 ms 348 KB Output is correct
14 Correct 0 ms 348 KB Output is correct
15 Correct 0 ms 348 KB Output is correct
16 Correct 0 ms 348 KB Output is correct
17 Correct 38 ms 348 KB Output is correct
18 Correct 35 ms 344 KB Output is correct
19 Correct 36 ms 348 KB Output is correct
20 Correct 26 ms 344 KB Output is correct
21 Correct 28 ms 348 KB Output is correct
22 Correct 28 ms 348 KB Output is correct
23 Correct 29 ms 348 KB Output is correct
24 Correct 12 ms 352 KB Output is correct
25 Correct 1421 ms 956 KB Output is correct
26 Correct 1470 ms 860 KB Output is correct
27 Correct 1448 ms 860 KB Output is correct
28 Correct 1000 ms 812 KB Output is correct
29 Correct 1199 ms 1112 KB Output is correct
30 Correct 1137 ms 1036 KB Output is correct
31 Correct 1202 ms 1000 KB Output is correct
32 Correct 1151 ms 1028 KB Output is correct
33 Execution timed out 5011 ms 7328 KB Time limit exceeded
34 Halted 0 ms 0 KB -