답안 #1021403

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1021403 2024-07-12T17:34:58 Z vjudge1 Rectangles (IOI19_rect) C++17
37 / 100
5000 ms 28436 KB
#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC target("avx2")
#pragma GCC optimization ("O3")
#pragma GCC optimization ("unroll-loops")
#pragma GCC target("popcnt")
#define endl '\n'
#define mp make_pair
#define pb push_back
#define fi first
#define se second
#define fo(i,n) for(auto i =0 ; i < n;i++)
#define fore(i,l,r) for(auto i = l; i < r;i++)
#define forex(i,r,l) for(auto i = r; i >= l; i--)
#define ffo(i,n) forex(i,n-1,0)
#define all(x) x.begin(),x.end()
#define lsb(x) x&(-x)
#define sz(x) (int)x.size()
#define gcd(a,b) __gcd(a,b)
#define vii vector<ii>
#define pq_min(a) priority_queue<a, vector<a>, greater<a>>
#define fls cout.flush()
using namespace std;
using ll = long long;
using ull = unsigned long long;
using vi = vector<int>;
using ii = pair<int,int>;
using mii = map<int,int>;
using lld = long double;
void valid(ll in){cout<<((in)?"YES\n":"NO\n");}
ll count_rectangles(vector<vi> a){
    ll ans = 0;
    int n = sz(a), m=(sz(a[0]));
    fore(r1,1,n-1){
        fore(c1,1,m-1){
            fore(r2,r1,n-1){
                fore(c2,c1,m-1){
                    bool cn = 1;
                    fore(i,r1,r2+1){
                        if(cn==0)break;
                        fore(j, c1, c2+1){
                            cn &= (a[i][j]<min({a[r1-1][j],a[i][c1-1], a[i][c2+1], a[r2+1][j]}));
                            if(cn==0)break;
                        }
                    }
                    ans+=cn;
                }
            }
        }
    }
    return ans;
}

Compilation message

rect.cpp:4: warning: ignoring '#pragma GCC optimization' [-Wunknown-pragmas]
    4 | #pragma GCC optimization ("O3")
      | 
rect.cpp:5: warning: ignoring '#pragma GCC optimization' [-Wunknown-pragmas]
    5 | #pragma GCC optimization ("unroll-loops")
      |
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 1 ms 348 KB Output is correct
5 Correct 1 ms 348 KB Output is correct
6 Correct 1 ms 348 KB Output is correct
7 Correct 0 ms 432 KB Output is correct
8 Correct 1 ms 344 KB Output is correct
9 Correct 1 ms 344 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 348 KB Output is correct
18 Correct 0 ms 348 KB Output is correct
19 Correct 1 ms 348 KB Output is correct
20 Correct 0 ms 344 KB Output is correct
21 Correct 0 ms 432 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 348 KB Output is correct
4 Correct 1 ms 348 KB Output is correct
5 Correct 1 ms 348 KB Output is correct
6 Correct 1 ms 348 KB Output is correct
7 Correct 0 ms 432 KB Output is correct
8 Correct 1 ms 344 KB Output is correct
9 Correct 1 ms 344 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 348 KB Output is correct
18 Correct 0 ms 348 KB Output is correct
19 Correct 1 ms 348 KB Output is correct
20 Correct 0 ms 344 KB Output is correct
21 Correct 0 ms 432 KB Output is correct
22 Correct 25 ms 348 KB Output is correct
23 Correct 25 ms 536 KB Output is correct
24 Correct 31 ms 348 KB Output is correct
25 Correct 19 ms 344 KB Output is correct
26 Correct 20 ms 508 KB Output is correct
27 Correct 21 ms 348 KB Output is correct
28 Correct 21 ms 348 KB Output is correct
29 Correct 6 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 348 KB Output is correct
4 Correct 1 ms 348 KB Output is correct
5 Correct 1 ms 348 KB Output is correct
6 Correct 1 ms 348 KB Output is correct
7 Correct 0 ms 432 KB Output is correct
8 Correct 1 ms 344 KB Output is correct
9 Correct 1 ms 344 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 25 ms 348 KB Output is correct
18 Correct 25 ms 536 KB Output is correct
19 Correct 31 ms 348 KB Output is correct
20 Correct 19 ms 344 KB Output is correct
21 Correct 20 ms 508 KB Output is correct
22 Correct 21 ms 348 KB Output is correct
23 Correct 21 ms 348 KB Output is correct
24 Correct 6 ms 348 KB Output is correct
25 Correct 0 ms 348 KB Output is correct
26 Correct 0 ms 348 KB Output is correct
27 Correct 1 ms 348 KB Output is correct
28 Correct 0 ms 344 KB Output is correct
29 Correct 0 ms 432 KB Output is correct
30 Correct 983 ms 964 KB Output is correct
31 Correct 997 ms 956 KB Output is correct
32 Correct 1016 ms 1040 KB Output is correct
33 Correct 728 ms 604 KB Output is correct
34 Correct 802 ms 880 KB Output is correct
35 Correct 797 ms 860 KB Output is correct
36 Correct 804 ms 860 KB Output is correct
37 Correct 771 ms 860 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 348 KB Output is correct
4 Correct 1 ms 348 KB Output is correct
5 Correct 1 ms 348 KB Output is correct
6 Correct 1 ms 348 KB Output is correct
7 Correct 0 ms 432 KB Output is correct
8 Correct 1 ms 344 KB Output is correct
9 Correct 1 ms 344 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 25 ms 348 KB Output is correct
18 Correct 25 ms 536 KB Output is correct
19 Correct 31 ms 348 KB Output is correct
20 Correct 19 ms 344 KB Output is correct
21 Correct 20 ms 508 KB Output is correct
22 Correct 21 ms 348 KB Output is correct
23 Correct 21 ms 348 KB Output is correct
24 Correct 6 ms 348 KB Output is correct
25 Correct 983 ms 964 KB Output is correct
26 Correct 997 ms 956 KB Output is correct
27 Correct 1016 ms 1040 KB Output is correct
28 Correct 728 ms 604 KB Output is correct
29 Correct 802 ms 880 KB Output is correct
30 Correct 797 ms 860 KB Output is correct
31 Correct 804 ms 860 KB Output is correct
32 Correct 771 ms 860 KB Output is correct
33 Correct 0 ms 348 KB Output is correct
34 Correct 0 ms 348 KB Output is correct
35 Correct 1 ms 348 KB Output is correct
36 Correct 0 ms 344 KB Output is correct
37 Correct 0 ms 432 KB Output is correct
38 Execution timed out 5018 ms 7252 KB Time limit exceeded
39 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 9 ms 344 KB Output is correct
2 Correct 7 ms 544 KB Output is correct
3 Correct 6 ms 348 KB Output is correct
4 Correct 1 ms 344 KB Output is correct
5 Correct 8 ms 348 KB Output is correct
6 Correct 13 ms 348 KB Output is correct
7 Correct 8 ms 348 KB Output is correct
8 Correct 8 ms 348 KB Output is correct
9 Correct 8 ms 556 KB Output is correct
10 Correct 0 ms 468 KB Output is correct
11 Correct 0 ms 492 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 0 ms 344 KB Output is correct
5 Correct 0 ms 432 KB Output is correct
6 Correct 1 ms 348 KB Output is correct
7 Execution timed out 5082 ms 28436 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 348 KB Output is correct
4 Correct 1 ms 348 KB Output is correct
5 Correct 1 ms 348 KB Output is correct
6 Correct 1 ms 348 KB Output is correct
7 Correct 0 ms 432 KB Output is correct
8 Correct 1 ms 344 KB Output is correct
9 Correct 1 ms 344 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 25 ms 348 KB Output is correct
18 Correct 25 ms 536 KB Output is correct
19 Correct 31 ms 348 KB Output is correct
20 Correct 19 ms 344 KB Output is correct
21 Correct 20 ms 508 KB Output is correct
22 Correct 21 ms 348 KB Output is correct
23 Correct 21 ms 348 KB Output is correct
24 Correct 6 ms 348 KB Output is correct
25 Correct 983 ms 964 KB Output is correct
26 Correct 997 ms 956 KB Output is correct
27 Correct 1016 ms 1040 KB Output is correct
28 Correct 728 ms 604 KB Output is correct
29 Correct 802 ms 880 KB Output is correct
30 Correct 797 ms 860 KB Output is correct
31 Correct 804 ms 860 KB Output is correct
32 Correct 771 ms 860 KB Output is correct
33 Execution timed out 5018 ms 7252 KB Time limit exceeded
34 Halted 0 ms 0 KB -