#include <iostream>
#include <vector>
#include <set>
#include <algorithm>
#include <stack>
using namespace std;
const int n_max = 2550; // make it not lag
vector<pair<int,bool>> h_seg[n_max][n_max];
vector<pair<int,bool>> v_seg[n_max][n_max];
vector<pair<int,int>> h_map[n_max][n_max];
vector<pair<int,int>> v_map[n_max][n_max];
int get_lower(set<int> &s, int val) {
auto it = s.lower_bound(val);
it--;
return *it;
}
void gen_h_seg(vector<int> &x, int r) {
/*
vector<pair<int,int>> ret;
vector<pair<int,int>> y;
for(int i=0; i<x.size(); i++) {
y.push_back(make_pair(-x[i],i));
}
sort(y.begin(), y.end());
set<int> s;
s.insert(-2e8);
s.insert(2e8);
for(int i=0; i<y.size(); i++) {
int z = get_lower(s,y[i].second);
if(z!=-2e8 && y[i].second!=z+1)
h_seg[r][z+1].push_back(make_pair(y[i].second-1, true));
z = *(s.upper_bound(y[i].second));
if((i+1==y.size() || (y[i].first!=y[i+1].first || z<y[i+1].second)) && z!=2e8 && y[i].second+1!=z) {
h_seg[r][y[i].second+1].push_back(make_pair(z-1,true));
}
s.insert(y[i].second);
}*/
stack<int> s;
s.push(0);
for(int i=1; i<x.size(); i++) {
while(!s.empty() && x[s.top()]<x[i]) {
if(s.top()!=i-1) {
h_seg[r][s.top()+1].push_back(make_pair(i-1, true));
//cout << r << " " << s.top()+1 << " " << i-1 << "\n";
}
int t = x[s.top()];
while(!s.empty() && x[s.top()]==t) {
s.pop();
}
}
if(!s.empty() && s.top()!=i-1) {
h_seg[r][s.top()+1].push_back(make_pair(i-1, true));
//cout << r << " " << s.top()+1 << " " << i-1 << "\n";
}
s.push(i);
}
}
struct fenwick {
int BIT[n_max], a[n_max], n;
fenwick(): n(0) {}
void reset() {
for(int i=0; i<n_max; i++) {
BIT[i] = 0;
a[i] = 0;
}
}
void update(int x, int delta)
{
for(; x <= n; x += x&-x)
BIT[x] += delta;
}
int query(int x) {
int sum = 0;
for(; x > 0; x -= x&-x)
sum += BIT[x];
return sum;
}
int query(int x, int y) {
return query(y)-query(x-1);
}
};
void gen_v_seg(vector<int> &x, int r) {
stack<int> s;
s.push(0);
for(int i=1; i<x.size(); i++) {
while(!s.empty() && x[s.top()]<x[i]) {
if(s.top()!=i-1) {
v_seg[r][s.top()+1].push_back(make_pair(i-1, true));
//cout << r << " " << s.top()+1 << " " << i-1 << "\n";
}
int t = x[s.top()];
while(!s.empty() && x[s.top()]==t) {
s.pop();
}
}
if(!s.empty() && s.top()!=i-1) {
v_seg[r][s.top()+1].push_back(make_pair(i-1, true));
//cout << r << " " << s.top()+1 << " " << i-1 << "\n";
}
s.push(i);
}
}
long long count_rectangles(vector<vector<int>> a) {
for(int i=0; i<a.size(); i++) {
gen_h_seg(a[i],i);
}
for(int i=0; i<a[0].size(); i++) {
vector<int> tmp;
for(int j=0; j<a.size(); j++) {
tmp.push_back(a[j][i]);
}
gen_v_seg(tmp, i);
}
for(int i=0; i<a.size(); i++) {
for(int j=0; j<a[0].size(); j++) {
sort(h_seg[i][j].begin(), h_seg[i][j].end());
sort(v_seg[j][i].begin(), v_seg[j][i].end());
}
}
for(int i=0; i<a.size(); i++) {
for(int j=0; j<a[0].size(); j++) {
for(auto &p: h_seg[i][j]) {
if(p.second) {
int down = i;
while(down+1!=a.size()) {
auto it = lower_bound(h_seg[down+1][j].begin(), h_seg[down+1][j].end(), make_pair(p.first,true));
if(it==h_seg[down+1][j].end()) break;
if(*it==make_pair(p.first, true)) {
it->second = false;
down++;
} else {
break;
}
}
h_map[i][j].push_back(make_pair(p.first, down));
}
}
}
}
for(int i=0; i<a[0].size(); i++) {
for(int j=0; j<a.size(); j++) {
for(auto &p: v_seg[i][j]) {
if(p.second) {
int down = i;
while(down+1!=a[0].size()) {
auto it = lower_bound(v_seg[down+1][j].begin(), v_seg[down+1][j].end(), make_pair(p.first,true));
if(it==v_seg[down+1][j].end()) break;
if(*it==make_pair(p.first, true)) {
it->second = false;
down++;
} else {
break;
}
}
v_map[i][j].push_back(make_pair(p.first, down));
//cout << "i,j,p.first,down(v): " << i << " " << j << " " << p.first << " " << down << "\n";
}
}
}
}
for(int i=a[0].size()-1; i>=0; i--) {
for(int j=a.size()-1; j>=0; j--) {
for(auto p: v_map[i][j]) {
for(int k=i+1; k<=p.second; k++) {
v_map[k][j].push_back(p);
//cout << "k,j,p: " << k << " " << j << " " << p.first << " " << p.second << "\n";
}
}
}
}
fenwick f[a.size()];
for(int i=0; i<a.size(); i++) {
f[i].n = a[0].size()+10;
f[i].reset();
}
long long ans = 0;
for(int i=0; i<a[0].size(); i++) {
vector<pair<int,int>> updates;
for(int j=0; j<a.size(); j++) {
//cout << "coordinate: " << i << " " << j << "\n";
for(auto p: h_map[j][i]) {
for(int k=j; k<=p.second; k++) {
f[k].update(p.first, 1);
//cout << "updated: " << k << "-th fenwick, position " << p.first << "increased by 1.\n";
updates.push_back(make_pair(k, p.first));
}
}
for(auto p: v_map[i][j]) {
int tmp = f[p.first].query(i,p.second);
ans += tmp;
//cout << "ans changed by " << tmp << " queried: " << p.first << " " << i << " " << p.second << "\n";
}
}
for(auto p: updates) {
f[p.first].update(p.second, -1);
//cout << "undo increment: " << p.first << " " << p.second << "\n";
}
}
//cout << "ans: " << ans << "\n";
return ans;
}
Compilation message
rect.cpp: In function 'void gen_h_seg(std::vector<int>&, int)':
rect.cpp:40:19: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for(int i=1; i<x.size(); i++) {
~^~~~~~~~~
rect.cpp: In function 'void gen_v_seg(std::vector<int>&, int)':
rect.cpp:85:19: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for(int i=1; i<x.size(); i++) {
~^~~~~~~~~
rect.cpp: In function 'long long int count_rectangles(std::vector<std::vector<int> >)':
rect.cpp:105:19: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for(int i=0; i<a.size(); i++) {
~^~~~~~~~~
rect.cpp:108:19: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for(int i=0; i<a[0].size(); i++) {
~^~~~~~~~~~~~
rect.cpp:110:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for(int j=0; j<a.size(); j++) {
~^~~~~~~~~
rect.cpp:115:19: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for(int i=0; i<a.size(); i++) {
~^~~~~~~~~
rect.cpp:116:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for(int j=0; j<a[0].size(); j++) {
~^~~~~~~~~~~~
rect.cpp:121:19: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for(int i=0; i<a.size(); i++) {
~^~~~~~~~~
rect.cpp:122:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for(int j=0; j<a[0].size(); j++) {
~^~~~~~~~~~~~
rect.cpp:127:33: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
while(down+1!=a.size()) {
~~~~~~^~~~~~~~~~
rect.cpp:142:19: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for(int i=0; i<a[0].size(); i++) {
~^~~~~~~~~~~~
rect.cpp:143:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for(int j=0; j<a.size(); j++) {
~^~~~~~~~~
rect.cpp:148:33: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
while(down+1!=a[0].size()) {
~~~~~~^~~~~~~~~~~~~
rect.cpp:175:19: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for(int i=0; i<a.size(); i++) {
~^~~~~~~~~
rect.cpp:181:19: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for(int i=0; i<a[0].size(); i++) {
~^~~~~~~~~~~~
rect.cpp:183:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for(int j=0; j<a.size(); j++) {
~^~~~~~~~~
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
569 ms |
611320 KB |
Output is correct |
2 |
Correct |
551 ms |
611832 KB |
Output is correct |
3 |
Correct |
555 ms |
611812 KB |
Output is correct |
4 |
Correct |
552 ms |
611820 KB |
Output is correct |
5 |
Correct |
554 ms |
611860 KB |
Output is correct |
6 |
Correct |
575 ms |
611824 KB |
Output is correct |
7 |
Correct |
586 ms |
611752 KB |
Output is correct |
8 |
Correct |
555 ms |
611480 KB |
Output is correct |
9 |
Correct |
565 ms |
611836 KB |
Output is correct |
10 |
Correct |
551 ms |
611804 KB |
Output is correct |
11 |
Correct |
549 ms |
611740 KB |
Output is correct |
12 |
Correct |
554 ms |
611832 KB |
Output is correct |
13 |
Correct |
556 ms |
611192 KB |
Output is correct |
14 |
Correct |
552 ms |
611320 KB |
Output is correct |
15 |
Correct |
600 ms |
611344 KB |
Output is correct |
16 |
Correct |
553 ms |
611192 KB |
Output is correct |
17 |
Correct |
550 ms |
611240 KB |
Output is correct |
18 |
Correct |
549 ms |
611272 KB |
Output is correct |
19 |
Correct |
551 ms |
611704 KB |
Output is correct |
20 |
Correct |
557 ms |
611804 KB |
Output is correct |
21 |
Correct |
551 ms |
611320 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
569 ms |
611320 KB |
Output is correct |
2 |
Correct |
551 ms |
611832 KB |
Output is correct |
3 |
Correct |
555 ms |
611812 KB |
Output is correct |
4 |
Correct |
552 ms |
611820 KB |
Output is correct |
5 |
Correct |
554 ms |
611860 KB |
Output is correct |
6 |
Correct |
575 ms |
611824 KB |
Output is correct |
7 |
Correct |
586 ms |
611752 KB |
Output is correct |
8 |
Correct |
555 ms |
611480 KB |
Output is correct |
9 |
Correct |
565 ms |
611836 KB |
Output is correct |
10 |
Correct |
551 ms |
611804 KB |
Output is correct |
11 |
Correct |
549 ms |
611740 KB |
Output is correct |
12 |
Correct |
554 ms |
611832 KB |
Output is correct |
13 |
Correct |
556 ms |
611192 KB |
Output is correct |
14 |
Correct |
552 ms |
611320 KB |
Output is correct |
15 |
Correct |
600 ms |
611344 KB |
Output is correct |
16 |
Correct |
553 ms |
611192 KB |
Output is correct |
17 |
Correct |
562 ms |
613328 KB |
Output is correct |
18 |
Correct |
565 ms |
613452 KB |
Output is correct |
19 |
Correct |
559 ms |
613528 KB |
Output is correct |
20 |
Correct |
555 ms |
613112 KB |
Output is correct |
21 |
Correct |
563 ms |
613232 KB |
Output is correct |
22 |
Correct |
555 ms |
613232 KB |
Output is correct |
23 |
Correct |
561 ms |
613240 KB |
Output is correct |
24 |
Correct |
556 ms |
612936 KB |
Output is correct |
25 |
Correct |
550 ms |
611240 KB |
Output is correct |
26 |
Correct |
549 ms |
611272 KB |
Output is correct |
27 |
Correct |
551 ms |
611704 KB |
Output is correct |
28 |
Correct |
557 ms |
611804 KB |
Output is correct |
29 |
Correct |
551 ms |
611320 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
569 ms |
611320 KB |
Output is correct |
2 |
Correct |
551 ms |
611832 KB |
Output is correct |
3 |
Correct |
555 ms |
611812 KB |
Output is correct |
4 |
Correct |
552 ms |
611820 KB |
Output is correct |
5 |
Correct |
554 ms |
611860 KB |
Output is correct |
6 |
Correct |
575 ms |
611824 KB |
Output is correct |
7 |
Correct |
586 ms |
611752 KB |
Output is correct |
8 |
Correct |
555 ms |
611480 KB |
Output is correct |
9 |
Correct |
565 ms |
611836 KB |
Output is correct |
10 |
Correct |
551 ms |
611804 KB |
Output is correct |
11 |
Correct |
549 ms |
611740 KB |
Output is correct |
12 |
Correct |
554 ms |
611832 KB |
Output is correct |
13 |
Correct |
556 ms |
611192 KB |
Output is correct |
14 |
Correct |
552 ms |
611320 KB |
Output is correct |
15 |
Correct |
600 ms |
611344 KB |
Output is correct |
16 |
Correct |
553 ms |
611192 KB |
Output is correct |
17 |
Correct |
562 ms |
613328 KB |
Output is correct |
18 |
Correct |
565 ms |
613452 KB |
Output is correct |
19 |
Correct |
559 ms |
613528 KB |
Output is correct |
20 |
Correct |
555 ms |
613112 KB |
Output is correct |
21 |
Correct |
563 ms |
613232 KB |
Output is correct |
22 |
Correct |
555 ms |
613232 KB |
Output is correct |
23 |
Correct |
561 ms |
613240 KB |
Output is correct |
24 |
Correct |
556 ms |
612936 KB |
Output is correct |
25 |
Correct |
575 ms |
619148 KB |
Output is correct |
26 |
Correct |
576 ms |
619128 KB |
Output is correct |
27 |
Correct |
583 ms |
619120 KB |
Output is correct |
28 |
Correct |
567 ms |
617052 KB |
Output is correct |
29 |
Correct |
582 ms |
618236 KB |
Output is correct |
30 |
Correct |
597 ms |
618188 KB |
Output is correct |
31 |
Correct |
603 ms |
618032 KB |
Output is correct |
32 |
Correct |
585 ms |
617868 KB |
Output is correct |
33 |
Correct |
550 ms |
611240 KB |
Output is correct |
34 |
Correct |
549 ms |
611272 KB |
Output is correct |
35 |
Correct |
551 ms |
611704 KB |
Output is correct |
36 |
Correct |
557 ms |
611804 KB |
Output is correct |
37 |
Correct |
551 ms |
611320 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
569 ms |
611320 KB |
Output is correct |
2 |
Correct |
551 ms |
611832 KB |
Output is correct |
3 |
Correct |
555 ms |
611812 KB |
Output is correct |
4 |
Correct |
552 ms |
611820 KB |
Output is correct |
5 |
Correct |
554 ms |
611860 KB |
Output is correct |
6 |
Correct |
575 ms |
611824 KB |
Output is correct |
7 |
Correct |
586 ms |
611752 KB |
Output is correct |
8 |
Correct |
555 ms |
611480 KB |
Output is correct |
9 |
Correct |
565 ms |
611836 KB |
Output is correct |
10 |
Correct |
551 ms |
611804 KB |
Output is correct |
11 |
Correct |
549 ms |
611740 KB |
Output is correct |
12 |
Correct |
554 ms |
611832 KB |
Output is correct |
13 |
Correct |
556 ms |
611192 KB |
Output is correct |
14 |
Correct |
552 ms |
611320 KB |
Output is correct |
15 |
Correct |
600 ms |
611344 KB |
Output is correct |
16 |
Correct |
553 ms |
611192 KB |
Output is correct |
17 |
Correct |
562 ms |
613328 KB |
Output is correct |
18 |
Correct |
565 ms |
613452 KB |
Output is correct |
19 |
Correct |
559 ms |
613528 KB |
Output is correct |
20 |
Correct |
555 ms |
613112 KB |
Output is correct |
21 |
Correct |
563 ms |
613232 KB |
Output is correct |
22 |
Correct |
555 ms |
613232 KB |
Output is correct |
23 |
Correct |
561 ms |
613240 KB |
Output is correct |
24 |
Correct |
556 ms |
612936 KB |
Output is correct |
25 |
Correct |
575 ms |
619148 KB |
Output is correct |
26 |
Correct |
576 ms |
619128 KB |
Output is correct |
27 |
Correct |
583 ms |
619120 KB |
Output is correct |
28 |
Correct |
567 ms |
617052 KB |
Output is correct |
29 |
Correct |
582 ms |
618236 KB |
Output is correct |
30 |
Correct |
597 ms |
618188 KB |
Output is correct |
31 |
Correct |
603 ms |
618032 KB |
Output is correct |
32 |
Correct |
585 ms |
617868 KB |
Output is correct |
33 |
Correct |
747 ms |
659668 KB |
Output is correct |
34 |
Correct |
707 ms |
650040 KB |
Output is correct |
35 |
Correct |
728 ms |
649996 KB |
Output is correct |
36 |
Correct |
667 ms |
640500 KB |
Output is correct |
37 |
Correct |
868 ms |
675088 KB |
Output is correct |
38 |
Correct |
870 ms |
675064 KB |
Output is correct |
39 |
Correct |
873 ms |
675104 KB |
Output is correct |
40 |
Correct |
862 ms |
670848 KB |
Output is correct |
41 |
Correct |
698 ms |
644020 KB |
Output is correct |
42 |
Correct |
740 ms |
648952 KB |
Output is correct |
43 |
Correct |
902 ms |
663656 KB |
Output is correct |
44 |
Correct |
900 ms |
663800 KB |
Output is correct |
45 |
Correct |
738 ms |
644448 KB |
Output is correct |
46 |
Correct |
721 ms |
637440 KB |
Output is correct |
47 |
Correct |
888 ms |
660076 KB |
Output is correct |
48 |
Correct |
885 ms |
660292 KB |
Output is correct |
49 |
Correct |
550 ms |
611240 KB |
Output is correct |
50 |
Correct |
549 ms |
611272 KB |
Output is correct |
51 |
Correct |
551 ms |
611704 KB |
Output is correct |
52 |
Correct |
557 ms |
611804 KB |
Output is correct |
53 |
Correct |
551 ms |
611320 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
557 ms |
611796 KB |
Output is correct |
2 |
Correct |
557 ms |
611704 KB |
Output is correct |
3 |
Correct |
556 ms |
611316 KB |
Output is correct |
4 |
Correct |
556 ms |
611216 KB |
Output is correct |
5 |
Correct |
586 ms |
611752 KB |
Output is correct |
6 |
Correct |
556 ms |
611576 KB |
Output is correct |
7 |
Correct |
551 ms |
611556 KB |
Output is correct |
8 |
Correct |
612 ms |
611572 KB |
Output is correct |
9 |
Correct |
559 ms |
611704 KB |
Output is correct |
10 |
Correct |
553 ms |
611400 KB |
Output is correct |
11 |
Correct |
553 ms |
611332 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
552 ms |
611396 KB |
Output is correct |
2 |
Correct |
1393 ms |
746344 KB |
Output is correct |
3 |
Correct |
2460 ms |
900732 KB |
Output is correct |
4 |
Correct |
2489 ms |
902076 KB |
Output is correct |
5 |
Correct |
2522 ms |
902192 KB |
Output is correct |
6 |
Correct |
856 ms |
659996 KB |
Output is correct |
7 |
Correct |
1132 ms |
707044 KB |
Output is correct |
8 |
Correct |
1216 ms |
710228 KB |
Output is correct |
9 |
Correct |
550 ms |
611240 KB |
Output is correct |
10 |
Correct |
549 ms |
611272 KB |
Output is correct |
11 |
Correct |
551 ms |
611704 KB |
Output is correct |
12 |
Correct |
557 ms |
611804 KB |
Output is correct |
13 |
Correct |
551 ms |
611320 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
569 ms |
611320 KB |
Output is correct |
2 |
Correct |
551 ms |
611832 KB |
Output is correct |
3 |
Correct |
555 ms |
611812 KB |
Output is correct |
4 |
Correct |
552 ms |
611820 KB |
Output is correct |
5 |
Correct |
554 ms |
611860 KB |
Output is correct |
6 |
Correct |
575 ms |
611824 KB |
Output is correct |
7 |
Correct |
586 ms |
611752 KB |
Output is correct |
8 |
Correct |
555 ms |
611480 KB |
Output is correct |
9 |
Correct |
565 ms |
611836 KB |
Output is correct |
10 |
Correct |
551 ms |
611804 KB |
Output is correct |
11 |
Correct |
549 ms |
611740 KB |
Output is correct |
12 |
Correct |
554 ms |
611832 KB |
Output is correct |
13 |
Correct |
556 ms |
611192 KB |
Output is correct |
14 |
Correct |
552 ms |
611320 KB |
Output is correct |
15 |
Correct |
600 ms |
611344 KB |
Output is correct |
16 |
Correct |
553 ms |
611192 KB |
Output is correct |
17 |
Correct |
562 ms |
613328 KB |
Output is correct |
18 |
Correct |
565 ms |
613452 KB |
Output is correct |
19 |
Correct |
559 ms |
613528 KB |
Output is correct |
20 |
Correct |
555 ms |
613112 KB |
Output is correct |
21 |
Correct |
563 ms |
613232 KB |
Output is correct |
22 |
Correct |
555 ms |
613232 KB |
Output is correct |
23 |
Correct |
561 ms |
613240 KB |
Output is correct |
24 |
Correct |
556 ms |
612936 KB |
Output is correct |
25 |
Correct |
575 ms |
619148 KB |
Output is correct |
26 |
Correct |
576 ms |
619128 KB |
Output is correct |
27 |
Correct |
583 ms |
619120 KB |
Output is correct |
28 |
Correct |
567 ms |
617052 KB |
Output is correct |
29 |
Correct |
582 ms |
618236 KB |
Output is correct |
30 |
Correct |
597 ms |
618188 KB |
Output is correct |
31 |
Correct |
603 ms |
618032 KB |
Output is correct |
32 |
Correct |
585 ms |
617868 KB |
Output is correct |
33 |
Correct |
747 ms |
659668 KB |
Output is correct |
34 |
Correct |
707 ms |
650040 KB |
Output is correct |
35 |
Correct |
728 ms |
649996 KB |
Output is correct |
36 |
Correct |
667 ms |
640500 KB |
Output is correct |
37 |
Correct |
868 ms |
675088 KB |
Output is correct |
38 |
Correct |
870 ms |
675064 KB |
Output is correct |
39 |
Correct |
873 ms |
675104 KB |
Output is correct |
40 |
Correct |
862 ms |
670848 KB |
Output is correct |
41 |
Correct |
698 ms |
644020 KB |
Output is correct |
42 |
Correct |
740 ms |
648952 KB |
Output is correct |
43 |
Correct |
902 ms |
663656 KB |
Output is correct |
44 |
Correct |
900 ms |
663800 KB |
Output is correct |
45 |
Correct |
738 ms |
644448 KB |
Output is correct |
46 |
Correct |
721 ms |
637440 KB |
Output is correct |
47 |
Correct |
888 ms |
660076 KB |
Output is correct |
48 |
Correct |
885 ms |
660292 KB |
Output is correct |
49 |
Correct |
557 ms |
611796 KB |
Output is correct |
50 |
Correct |
557 ms |
611704 KB |
Output is correct |
51 |
Correct |
556 ms |
611316 KB |
Output is correct |
52 |
Correct |
556 ms |
611216 KB |
Output is correct |
53 |
Correct |
586 ms |
611752 KB |
Output is correct |
54 |
Correct |
556 ms |
611576 KB |
Output is correct |
55 |
Correct |
551 ms |
611556 KB |
Output is correct |
56 |
Correct |
612 ms |
611572 KB |
Output is correct |
57 |
Correct |
559 ms |
611704 KB |
Output is correct |
58 |
Correct |
553 ms |
611400 KB |
Output is correct |
59 |
Correct |
553 ms |
611332 KB |
Output is correct |
60 |
Correct |
552 ms |
611396 KB |
Output is correct |
61 |
Correct |
1393 ms |
746344 KB |
Output is correct |
62 |
Correct |
2460 ms |
900732 KB |
Output is correct |
63 |
Correct |
2489 ms |
902076 KB |
Output is correct |
64 |
Correct |
2522 ms |
902192 KB |
Output is correct |
65 |
Correct |
856 ms |
659996 KB |
Output is correct |
66 |
Correct |
1132 ms |
707044 KB |
Output is correct |
67 |
Correct |
1216 ms |
710228 KB |
Output is correct |
68 |
Runtime error |
1920 ms |
1048576 KB |
Execution killed with signal 9 (could be triggered by violating memory limits) |
69 |
Halted |
0 ms |
0 KB |
- |