//
#ifndef __SIZEOF_INT128__
#define __SIZEOF_INT128__
#endif
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace chrono;
using namespace __gnu_pbds;
template <typename T> using oset = tree<T, null_type, less_equal<T>, rb_tree_tag, tree_order_statistics_node_update>;
#define rep(i, p, k) for(int i(p); i < (k); ++i)
#define per(i, p, k) for(int i(p); i > (k); --i)
#define sz(x) (int)(x).size()
#define sc static_cast
typedef long long ll;
typedef long double ld;
typedef unsigned int uint;
typedef unsigned long long ull;
typedef __int128_t lll;
//#define int ll
template <typename T = int> using par = std::pair <T, T>;
#define fi first
#define se second
#define test int _number_of_tests(in()); while(_number_of_tests--)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define pb emplace_back
struct Timer {
string name{""};
time_point<high_resolution_clock> end, start{high_resolution_clock::now()};
duration<float, std::milli> dur;
Timer() = default;
Timer(string nm): name(nm) {}
~Timer() {
end = high_resolution_clock::now(); dur= end - start;
cout << "@" << name << "> " << dur.count() << " ms" << '\n';
}
};
template <typename T = int> inline T in()
{
static T x;
std::cin >> x;
return x;
}
std::string yn(bool b)
{
if(b) return "YES\n";
else return "NO\n";
}
template <typename F, typename S> std::ostream& operator<<(std::ostream& out, const std::pair <F, S>& par);
template <typename T> std::ostream& operator<< (std::ostream& out, const std::vector <T>& wek)
{
for(const auto& i : wek)out << i << ' ';
return out;
}
template <typename F, typename S> std::ostream& operator<<(std::ostream& out, const std::pair <F, S>& par)
{
out << '{'<<par.first<<", "<<par.second<<"}";
return out;
}
#define show(x) cerr << #x << " = " << x << '\n';
ll count_rectangles(vector <vector <int>> a)
{
int n(sz(a)), m(sz(a[0]));
int o(0);
rep(x1, 0, n) rep(x2, x1+2, n) rep(y1, 0, m)rep(y2, y1+2, m){
bool b(1);
rep(i, x1+1, x2)rep(j, y1+1, y2)b &= a[i][j] < min({a[x1][j], a[x2][j], a[i][y1], a[i][y2]});
o += b;
}
return o;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
18 ms |
436 KB |
Output is correct |
3 |
Correct |
18 ms |
348 KB |
Output is correct |
4 |
Correct |
22 ms |
436 KB |
Output is correct |
5 |
Correct |
18 ms |
436 KB |
Output is correct |
6 |
Correct |
17 ms |
436 KB |
Output is correct |
7 |
Correct |
2 ms |
344 KB |
Output is correct |
8 |
Correct |
1 ms |
348 KB |
Output is correct |
9 |
Correct |
18 ms |
348 KB |
Output is correct |
10 |
Correct |
18 ms |
348 KB |
Output is correct |
11 |
Correct |
18 ms |
440 KB |
Output is correct |
12 |
Correct |
18 ms |
440 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 |
1 ms |
344 KB |
Output is correct |
18 |
Correct |
0 ms |
348 KB |
Output is correct |
19 |
Correct |
19 ms |
432 KB |
Output is correct |
20 |
Correct |
3 ms |
348 KB |
Output is correct |
21 |
Correct |
1 ms |
348 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
18 ms |
436 KB |
Output is correct |
3 |
Correct |
18 ms |
348 KB |
Output is correct |
4 |
Correct |
22 ms |
436 KB |
Output is correct |
5 |
Correct |
18 ms |
436 KB |
Output is correct |
6 |
Correct |
17 ms |
436 KB |
Output is correct |
7 |
Correct |
2 ms |
344 KB |
Output is correct |
8 |
Correct |
1 ms |
348 KB |
Output is correct |
9 |
Correct |
18 ms |
348 KB |
Output is correct |
10 |
Correct |
18 ms |
348 KB |
Output is correct |
11 |
Correct |
18 ms |
440 KB |
Output is correct |
12 |
Correct |
18 ms |
440 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 |
1 ms |
344 KB |
Output is correct |
18 |
Correct |
0 ms |
348 KB |
Output is correct |
19 |
Correct |
19 ms |
432 KB |
Output is correct |
20 |
Correct |
3 ms |
348 KB |
Output is correct |
21 |
Correct |
1 ms |
348 KB |
Output is correct |
22 |
Execution timed out |
5018 ms |
348 KB |
Time limit exceeded |
23 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
18 ms |
436 KB |
Output is correct |
3 |
Correct |
18 ms |
348 KB |
Output is correct |
4 |
Correct |
22 ms |
436 KB |
Output is correct |
5 |
Correct |
18 ms |
436 KB |
Output is correct |
6 |
Correct |
17 ms |
436 KB |
Output is correct |
7 |
Correct |
2 ms |
344 KB |
Output is correct |
8 |
Correct |
1 ms |
348 KB |
Output is correct |
9 |
Correct |
18 ms |
348 KB |
Output is correct |
10 |
Correct |
18 ms |
348 KB |
Output is correct |
11 |
Correct |
18 ms |
440 KB |
Output is correct |
12 |
Correct |
18 ms |
440 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 |
Execution timed out |
5018 ms |
348 KB |
Time limit exceeded |
18 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
18 ms |
436 KB |
Output is correct |
3 |
Correct |
18 ms |
348 KB |
Output is correct |
4 |
Correct |
22 ms |
436 KB |
Output is correct |
5 |
Correct |
18 ms |
436 KB |
Output is correct |
6 |
Correct |
17 ms |
436 KB |
Output is correct |
7 |
Correct |
2 ms |
344 KB |
Output is correct |
8 |
Correct |
1 ms |
348 KB |
Output is correct |
9 |
Correct |
18 ms |
348 KB |
Output is correct |
10 |
Correct |
18 ms |
348 KB |
Output is correct |
11 |
Correct |
18 ms |
440 KB |
Output is correct |
12 |
Correct |
18 ms |
440 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 |
Execution timed out |
5018 ms |
348 KB |
Time limit exceeded |
18 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2780 ms |
468 KB |
Output is correct |
2 |
Correct |
1718 ms |
512 KB |
Output is correct |
3 |
Correct |
2714 ms |
488 KB |
Output is correct |
4 |
Correct |
1 ms |
600 KB |
Output is correct |
5 |
Correct |
2604 ms |
344 KB |
Output is correct |
6 |
Correct |
2626 ms |
348 KB |
Output is correct |
7 |
Correct |
2643 ms |
348 KB |
Output is correct |
8 |
Correct |
2631 ms |
504 KB |
Output is correct |
9 |
Correct |
2615 ms |
536 KB |
Output is correct |
10 |
Correct |
0 ms |
348 KB |
Output is correct |
11 |
Correct |
0 ms |
348 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
19 ms |
432 KB |
Output is correct |
4 |
Correct |
3 ms |
348 KB |
Output is correct |
5 |
Correct |
1 ms |
348 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Execution timed out |
5093 ms |
22700 KB |
Time limit exceeded |
8 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
18 ms |
436 KB |
Output is correct |
3 |
Correct |
18 ms |
348 KB |
Output is correct |
4 |
Correct |
22 ms |
436 KB |
Output is correct |
5 |
Correct |
18 ms |
436 KB |
Output is correct |
6 |
Correct |
17 ms |
436 KB |
Output is correct |
7 |
Correct |
2 ms |
344 KB |
Output is correct |
8 |
Correct |
1 ms |
348 KB |
Output is correct |
9 |
Correct |
18 ms |
348 KB |
Output is correct |
10 |
Correct |
18 ms |
348 KB |
Output is correct |
11 |
Correct |
18 ms |
440 KB |
Output is correct |
12 |
Correct |
18 ms |
440 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 |
Execution timed out |
5018 ms |
348 KB |
Time limit exceeded |
18 |
Halted |
0 ms |
0 KB |
- |